aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-03-26 20:23:35 +0100
committerEgor Tensin <egor@tensin.name>2026-03-26 23:17:58 +0100
commitc56003f8a92d2837ff4bac535b4dbce212426ef1 (patch)
tree1566e1eba4df18c7ff0c54b50776acd69eeef1ba
parentdependabot: check directories recursively (diff)
downloadcimple-c56003f8a92d2837ff4bac535b4dbce212426ef1.tar.gz
cimple-c56003f8a92d2837ff4bac535b4dbce212426ef1.zip
workflows/ci: do Docker builds on PRs
-rw-r--r--.github/workflows/ci.yml24
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'