mirror of
https://github.com/booklore-app/booklore.git
synced 2026-02-18 00:17:53 +01:00
Add multi-arch Docker build support to GitHub Actions
This commit is contained in:
committed by
Aditya Chandel
parent
6631b44bbc
commit
05b7be093c
24
.github/workflows/docker-build-publish.yml
vendored
24
.github/workflows/docker-build-publish.yml
vendored
@@ -20,6 +20,12 @@ jobs:
|
||||
- name: Log in to GitHub Container Registry
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Set up QEMU for multi-arch builds
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Get Latest Master Version
|
||||
id: get_version
|
||||
run: |
|
||||
@@ -63,19 +69,21 @@ jobs:
|
||||
git tag ${{ env.new_tag }}
|
||||
git push origin ${{ env.new_tag }}
|
||||
|
||||
- name: Build Docker Image
|
||||
- name: Build and Push Docker Image
|
||||
run: |
|
||||
docker build -t ghcr.io/${{ github.actor }}/booklore-app:${{ env.image_tag }} .
|
||||
|
||||
- name: Push Docker Image to GHCR
|
||||
run: |
|
||||
docker push ghcr.io/${{ github.actor }}/booklore-app:${{ env.image_tag }}
|
||||
docker buildx create --use
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--tag ghcr.io/${{ github.actor }}/booklore-app:${{ env.image_tag }} \
|
||||
--push .
|
||||
|
||||
- name: Push Latest Tag (Only for Master)
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
docker tag ghcr.io/${{ github.actor }}/booklore-app:${{ env.new_tag }} ghcr.io/${{ github.actor }}/booklore-app:latest
|
||||
docker push ghcr.io/${{ github.actor }}/booklore-app:latest
|
||||
docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
--tag ghcr.io/${{ github.actor }}/booklore-app:latest \
|
||||
--push .
|
||||
|
||||
- name: Create GitHub Release (Only for Master)
|
||||
if: github.ref == 'refs/heads/master'
|
||||
|
||||
Reference in New Issue
Block a user