diff --git a/.github/workflows/docker_runner-conda.yml b/.github/workflows/docker_runner-conda.yml index 9af66b26..03b3a9e8 100644 --- a/.github/workflows/docker_runner-conda.yml +++ b/.github/workflows/docker_runner-conda.yml @@ -5,9 +5,11 @@ on: push: branches: - main + - '**staging' paths: - 'runners/conda-dockerfile' - 'runners/r-environment.yml' + - 'runners/python-environment.yml' - 'runners/.condarc' jobs: @@ -23,8 +25,9 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Extract metadata (tags, labels) for Docker - id: meta + - name: Extract metadata (tags, labels) for Docker, main branch + if: github.ref == 'refs/heads/main' + id: metadata-main uses: docker/metadata-action@v4 with: images: geobon/bon-in-a-box @@ -34,6 +37,16 @@ jobs: # In case we want to replicate a specific legacy setup type=sha,prefix=runner-conda- + - name: Extract metadata (tags, labels) for Docker, staging branch + if: github.ref != 'refs/heads/main' + id: metadata-staging + uses: docker/metadata-action@v4 + with: + images: geobon/bon-in-a-box + tags: | + # Image used in compose file + type=raw,value=runner-conda-${{github.ref_name}} + - name: Build and push Docker image uses: docker/build-push-action@v3 with: diff --git a/.github/workflows/docker_runner-julia.yml b/.github/workflows/docker_runner-julia.yml index 845e1730..b3df8ee1 100644 --- a/.github/workflows/docker_runner-julia.yml +++ b/.github/workflows/docker_runner-julia.yml @@ -5,6 +5,7 @@ on: push: branches: - main + - '**staging' paths: - 'runners/julia-dockerfile' @@ -14,14 +15,15 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v3 - + - name: Log in to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker + + - name: Extract metadata (tags, labels) for Docker, main branch + if: github.ref == 'refs/heads/main' id: meta uses: docker/metadata-action@v4 with: @@ -31,7 +33,17 @@ jobs: type=raw,value=runner-julia # In case we want to replicate a specific legacy setup type=sha,prefix=runner-julia- - + + - name: Extract metadata (tags, labels) for Docker, staging branch + if: github.ref != 'refs/heads/main' + id: metadata-staging + uses: docker/metadata-action@v4 + with: + images: geobon/bon-in-a-box + tags: | + # Image used in compose file + type=raw,value=runner-julia-${{github.ref_name}} + - name: Build and push Docker image uses: docker/build-push-action@v3 with: @@ -40,4 +52,4 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - +