Skip to content

Commit

Permalink
feat: add arm64 build support
Browse files Browse the repository at this point in the history
  • Loading branch information
texano00 committed Jul 18, 2024
1 parent d05bd19 commit 650e220
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/CI_CD_App.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,38 @@ jobs:
run: |
version=$(cat .version)
echo "version=${version}" >> $GITHUB_OUTPUT
- name: docker build and push
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PASSWORD }}
registry: ${{ env.REGISTRY }}


- name: Check if version already exist
id: build_and_push
run: |
built_image="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.metadata.outputs.version }}"
docker login ${{ env.REGISTRY }} -u ${{ secrets.GHCR_USERNAME }} -p ${{ secrets.GHCR_PASSWORD }}
if docker manifest inspect ${built_image} > /dev/null; then
echo "already exist -> do not push"
exit 1
else
echo "does not exist -> push"
docker buildx build --platform linux/amd64,linux/arm64/v8,linux/arm/v6,linux/arm/v7 -t ${built_image} --push .
echo "does not exist -> going on"
fi
- name: Build and Push Image
uses: docker/build-push-action@v6
with:
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.metadata.outputs.version }}
platforms: linux/amd64,linux/arm64/v8,linux/arm/v6,linux/arm/v7
push: true


0 comments on commit 650e220

Please sign in to comment.