aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-03-27 07:52:06 +0100
committerEgor Tensin <egor@tensin.name>2026-03-27 07:52:06 +0100
commit3b6f965db2643c94b35f419cc6aeedfff92d8544 (patch)
tree1795a0828c5c407c784ab28055ff06f9833f9475 /.github/workflows
parentdependabot: update versions for more stuff (diff)
downloadmath-server-3b6f965db2643c94b35f419cc6aeedfff92d8544.tar.gz
math-server-3b6f965db2643c94b35f419cc6aeedfff92d8544.zip
workflows/ci: do Docker builds on PRs
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/ci.yml22
1 files changed, 13 insertions, 9 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e7cfc54..3ea3a4c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -83,20 +83,24 @@ 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
+ 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 math-${{ matrix.project }}'
uses: docker/build-push-action@v7
with:
@@ -104,6 +108,6 @@ jobs:
# https://stackoverflow.com/a/74552407/514684
context: .
file: '${{ matrix.project }}/Dockerfile'
- 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 }}/math-${{ matrix.project }}:latest'