mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-04-24 03:42:13 +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:
|
jobs:
|
||||||
build_amd:
|
build_amd:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -53,7 +56,7 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push AMD64 image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@ -64,8 +67,11 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
build_arm:
|
build_arm:
|
||||||
runs-on: ubuntu-latest
|
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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -80,14 +86,8 @@ jobs:
|
|||||||
images: |
|
images: |
|
||||||
ghcr.io/tcgdex/server
|
ghcr.io/tcgdex/server
|
||||||
tcgdex/server
|
tcgdex/server
|
||||||
tags: |
|
tags: ${{ needs.build_amd.outputs.tags }}
|
||||||
type=edge
|
labels: ${{ needs.build_amd.outputs.labels }}
|
||||||
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
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@ -104,21 +104,22 @@ jobs:
|
|||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
|
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
|
||||||
|
|
||||||
|
- name: Set up QEMU for ARM emulation
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
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
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/arm64
|
platforms: linux/arm64
|
||||||
push: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
|
push: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ needs.build_amd.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ needs.build_amd.outputs.labels }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
Loading…
x
Reference in New Issue
Block a user