aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-03-26 20:12:47 +0100
committerEgor Tensin <egor@tensin.name>2026-03-26 23:32:49 +0100
commit63910dcd77ee9f7b7d8eb7d91cbe934ac566e7da (patch)
treed0cc982f90e1e82a0a1e1e4f733129753f1875a8 /.github
parentMerge pull request #16 from egor-tensin/dependabot/docker/test/integration/do... (diff)
downloadcgitize-63910dcd77ee9f7b7d8eb7d91cbe934ac566e7da.tar.gz
cgitize-63910dcd77ee9f7b7d8eb7d91cbe934ac566e7da.zip
workflows/ci: do Docker builds on PRs
Diffstat (limited to '')
-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 5403616..076e36d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -83,7 +83,6 @@ jobs:
- {service: backend, file: docker/Dockerfile, image: cgitize}
- {service: frontend, context: docker/frontend, image: cgitize-frontend}
name: 'Publish / Docker Hub / ${{ matrix.service }}'
- if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -104,28 +103,35 @@ 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?
+ - 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: '${{ secrets.DOCKERHUB_USERNAME }}'
+ password: '${{ secrets.DOCKERHUB_TOKEN }}'
- name: Build and publish
uses: docker/build-push-action@v7
with:
context: '${{ matrix.context }}'
file: '${{ matrix.file }}'
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 }}'
publish_pypi: