mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-04-27 08:37:47 -05:00
chore: update docker workflow to be default branch aware
This commit is contained in:
parent
cad56cd5b8
commit
462afd7c04
10
.github/workflows/docker.yml
vendored
10
.github/workflows/docker.yml
vendored
|
|
@ -8,12 +8,12 @@ on:
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
DEFAULT_BRANCH: ${{ format('refs/heads/{0}', github.event.repository.default_branch) }}
|
||||||
|
SHOULD_PUSH_IMAGE: ${{ (github.event_name == 'push' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || github.ref == 'refs/heads/dev')) || github.event_name == 'workflow_dispatch' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-publish-amd64:
|
build-publish-amd64:
|
||||||
name: Build and Publish Docker Image (amd64)
|
name: Build and Publish Docker Image (amd64)
|
||||||
env:
|
|
||||||
SHOULD_PUSH_IMAGE: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev')) || github.event_name == 'workflow_dispatch' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|
@ -41,7 +41,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
type=raw,value=latest,enable=${{ github.ref == env.DEFAULT_BRANCH }}
|
||||||
type=raw,value=edge,enable=${{ github.ref == 'refs/heads/dev' }}
|
type=raw,value=edge,enable=${{ github.ref == 'refs/heads/dev' }}
|
||||||
type=sha
|
type=sha
|
||||||
|
|
||||||
|
|
@ -58,8 +58,6 @@ jobs:
|
||||||
|
|
||||||
build-publish-arm64:
|
build-publish-arm64:
|
||||||
name: Build and Publish Docker Image (arm64)
|
name: Build and Publish Docker Image (arm64)
|
||||||
env:
|
|
||||||
SHOULD_PUSH_IMAGE: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev')) || github.event_name == 'workflow_dispatch' }}
|
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04-arm
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|
@ -87,7 +85,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest-arm,enable=${{ github.ref == 'refs/heads/master' }}
|
type=raw,value=latest-arm,enable=${{ github.ref == env.DEFAULT_BRANCH }}
|
||||||
type=raw,value=edge-arm,enable=${{ github.ref == 'refs/heads/dev' }}
|
type=raw,value=edge-arm,enable=${{ github.ref == 'refs/heads/dev' }}
|
||||||
type=sha,suffix=-arm
|
type=sha,suffix=-arm
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user