update CI #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "build" | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GHCR_TOKEN }} | |
- name: Pull pre-built Docker image | |
run: docker pull ghcr.io/${{ github.repository }}:latest | |
- name: Install Nextflow | |
uses: stracquadaniolab/[email protected] | |
- name: Cache Nextflow dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.HOME }}/.nextflow | |
key: ${{ runner.os }}-nextflow-${{ hashFiles('nextflow.config') }} | |
restore-keys: | | |
${{ runner.os }}-nextflow- | |
- name: Test Nextflow pipeline | |
run: | | |
docker run --rm \ | |
-v ${{ github.workspace }}:/workspace \ | |
-w /workspace \ | |
ghcr.io/${{ github.repository }}:latest \ | |
nextflow run . -profile test,ci,docker | |
- name: Push image to GitHub Container Registry | |
if: startsWith(github.event.ref, 'refs/tags') | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: containers/Dockerfile | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository }}:v0.0.10, ghcr.io/${{ github.repository }}:latest |