Skip to content

Commit cacbc3e

Browse files
committed
only create arm64 on main/dev branch
1 parent 47cfb1e commit cacbc3e

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/docker-image.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,21 @@ jobs:
6565
username: ${{ secrets.DOCKER_HUB_USERNAME }}
6666
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
6767

68+
- name: Set platforms
69+
id: set_platforms
70+
run: |
71+
echo "github ref: ${GITHUB_REF}"
72+
if [[ "${GITHUB_REF##*/}" == "main" || "${GITHUB_REF##*/}" == "dev" ]]; then
73+
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
74+
else
75+
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
76+
fi
77+
6878
- name: Build and push
6979
uses: docker/build-push-action@v6
7080
with:
7181
context: .
72-
platforms: linux/amd64,linux/arm64
82+
platforms: ${{ steps.set_platforms.outputs.platforms }}
7383
push: true
7484
#${{ github.event_name != 'push' && github.event_name != 'pull_request' }}
7585
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)