aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-03-29 09:15:51 +0200
committerEgor Tensin <egor@tensin.name>2026-03-29 09:15:51 +0200
commit1f40813fedccdaaf5f9441a715fd7ed06cd04cad (patch)
treea61908d32ebf987e7b7b63ddf4cdeac788a320f0 /.github/workflows
parenttest: fix Compose warnings (diff)
downloadwg-api-web-1f40813fedccdaaf5f9441a715fd7ed06cd04cad.tar.gz
wg-api-web-1f40813fedccdaaf5f9441a715fd7ed06cd04cad.zip
workflows/ci: do Docker builds on PRs
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yml30
1 files changed, 18 insertions, 12 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f761f73..19551dc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -29,7 +29,6 @@ jobs:
needs: [test_host, test_linuxserver]
runs-on: ubuntu-latest
name: 'Publish'
- if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -50,20 +49,27 @@ 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: egortensin
- password: '${{ secrets.DOCKERHUB_TOKEN }}'
- - id: platforms
- name: Which platforms?
+ - name: Push? Which platforms?
+ id: params
# Building for ARM for every commit 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' >> "$GITHUB_OUTPUT"
- else
+ elif ${{ startsWith(github.ref, 'refs/tags/') }}; 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: egortensin
+ password: '${{ secrets.DOCKERHUB_TOKEN }}'
- name: Build and publish
uses: docker/build-push-action@v7
with:
@@ -71,6 +77,6 @@ jobs:
# https://stackoverflow.com/a/74552407/514684
context: .
labels: '${{ steps.meta.outputs.labels }}'
- platforms: '${{ steps.platforms.outputs.platforms }}'
- push: true
+ platforms: '${{ steps.params.outputs.platforms }}'
+ push: '${{ steps.params.outputs.push }}'
tags: '${{ steps.meta.outputs.tags }}'