mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-04-23 19:32:11 +00:00
Update build.yml
This commit is contained in:
parent
5cb5dc8e44
commit
c76d63a58c
29
.github/workflows/build.yml
vendored
29
.github/workflows/build.yml
vendored
@ -12,6 +12,9 @@ on:
|
||||
jobs:
|
||||
build_amd:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -53,7 +56,7 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push
|
||||
- name: Build and push AMD64 image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
@ -64,8 +67,11 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
build_arm:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build_amd # Ensures ARM64 build waits for AMD64 to finish
|
||||
# if: github.event_name != 'pull_request' # Optional: Skip ARM64 build on PRs for faster feedback
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -80,14 +86,8 @@ jobs:
|
||||
images: |
|
||||
ghcr.io/tcgdex/server
|
||||
tcgdex/server
|
||||
tags: |
|
||||
type=edge
|
||||
type=ref,event=pr
|
||||
type=ref,event=branch,prefix=branch-
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=semver,pattern=latest
|
||||
tags: ${{ needs.build_amd.outputs.tags }}
|
||||
labels: ${{ needs.build_amd.outputs.labels }}
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
@ -104,21 +104,22 @@ jobs:
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
|
||||
|
||||
|
||||
- name: Set up QEMU
|
||||
- name: Set up QEMU for ARM emulation
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
install: true
|
||||
|
||||
- name: Build and push
|
||||
- name: Build and push ARM64 image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/arm64
|
||||
push: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
|
||||
file: ./Dockerfile
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
tags: ${{ needs.build_amd.outputs.tags }}
|
||||
labels: ${{ needs.build_amd.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
Loading…
x
Reference in New Issue
Block a user