diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yml | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fdb77e..0f29e4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,26 +162,30 @@ jobs: uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 - - name: Login to Docker Hub - uses: docker/login-action@v4 - with: - username: '${{ secrets.DOCKERHUB_USERNAME }}' - password: '${{ secrets.DOCKERHUB_TOKEN }}' - - id: platforms - name: Which platforms? + - id: params + name: Push? Which platforms? # Building for ARM for every commit not in master is too time-consuming. run: | - if [ '${{ github.ref }}' = 'refs/heads/master' ]; then + if ${{ github.ref == 'refs/heads/master' }}; then + echo 'push=true' >> "$GITHUB_OUTPUT" echo 'platforms=amd64,armhf,arm64' >> "$GITHUB_OUTPUT" else + echo 'push=false' >> "$GITHUB_OUTPUT" echo 'platforms=amd64' >> "$GITHUB_OUTPUT" fi + - name: Login to Docker Hub + # https://github.com/orgs/community/discussions/163013 + if: steps.params.outputs.push == 'true' + uses: docker/login-action@v4 + with: + username: '${{ secrets.DOCKERHUB_USERNAME }}' + password: '${{ secrets.DOCKERHUB_TOKEN }}' - name: Publish uses: docker/build-push-action@v7 with: # Without context, .dockerignore is not respected? # https://stackoverflow.com/a/74552407/514684 context: . - platforms: '${{ steps.platforms.outputs.platforms }}' - push: ${{ github.ref == 'refs/heads/master' }} + platforms: '${{ steps.params.outputs.platforms }}' + push: '${{ steps.params.outputs.push }}' tags: '${{ secrets.DOCKERHUB_USERNAME }}/cimple:latest' |
