diff options
| author | Egor Tensin <egor@tensin.name> | 2026-03-27 00:30:51 +0100 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-03-27 00:30:51 +0100 |
| commit | 277ef0b885b8561fb8d313c9e25bc55744459681 (patch) | |
| tree | e1aed826ec41a70c6702c3cc83c86af50de52d0a /.github/workflows | |
| parent | dependabot: update versions for more stuff (diff) | |
| download | void-277ef0b885b8561fb8d313c9e25bc55744459681.tar.gz void-277ef0b885b8561fb8d313c9e25bc55744459681.zip | |
workflows/ci: run Docker builds on PRs
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/ci.yml | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 549eaa4..6495393 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,6 @@ jobs: needs: [test] runs-on: ubuntu-latest name: 'Publish: Docker Hub' - if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') steps: - name: Checkout uses: actions/checkout@v6 @@ -46,7 +45,20 @@ jobs: uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v4 + - 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 + 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 }}' @@ -58,6 +70,6 @@ jobs: # https://stackoverflow.com/a/74552407/514684 context: . labels: '${{ steps.meta.outputs.labels }}' - platforms: amd64,armhf,arm64 - push: true + platforms: '${{ steps.params.outputs.platforms }}' + push: '${{ steps.params.outputs.push }}' tags: '${{ steps.meta.outputs.tags }}' |
