feat(image-build): use Docker buildx, publish multi arch images
This commit is contained in:
parent
ae3fc5f802
commit
66f1e19ce8
|
@ -17,6 +17,8 @@ jobs:
|
|||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
install: true
|
||||
|
||||
- name: Log in to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
|
@ -32,15 +34,13 @@ jobs:
|
|||
- name: Build and push Docker image
|
||||
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
||||
run: |
|
||||
docker build -f backend.dockerfile -t itzcrazykns1337/perplexica-backend:main .
|
||||
docker build -f app.dockerfile -t itzcrazykns1337/perplexica-frontend:main .
|
||||
docker push itzcrazykns1337/perplexica-backend:main
|
||||
docker push itzcrazykns1337/perplexica-frontend:main
|
||||
docker buildx create --use
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -f backend.dockerfile -t itzcrazykns1337/perplexica-backend:main --push .
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -f app.dockerfile -t itzcrazykns1337/perplexica-frontend:main --push .
|
||||
|
||||
- name: Build and push release Docker image
|
||||
if: github.event_name == 'release'
|
||||
run: |
|
||||
docker build -f backend.dockerfile -t itzcrazykns1337/perplexica-backend:${{ env.RELEASE_VERSION }} .
|
||||
docker build -f app.dockerfile -t itzcrazykns1337/perplexica-frontend:${{ env.RELEASE_VERSION }} .
|
||||
docker push itzcrazykns1337/perplexica-backend:${{ env.RELEASE_VERSION }}
|
||||
docker push itzcrazykns1337/perplexica-frontend:${{ env.RELEASE_VERSION }}
|
||||
docker buildx create --use
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -f backend.dockerfile -t itzcrazykns1337/perplexica-backend:${{ env.RELEASE_VERSION }} --push .
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -f app.dockerfile -t itzcrazykns1337/perplexica-frontend:${{ env.RELEASE_VERSION }} --push .
|
Loading…
Reference in New Issue