Refactor: make it possible to disable ARM builds in private repos
This commit is contained in:
parent
9ea8b639f0
commit
486888aea8
1 changed files with 14 additions and 4 deletions
18
.github/workflows/main.yml
vendored
18
.github/workflows/main.yml
vendored
|
|
@ -24,6 +24,7 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ${{ vars.REGISTRY != '' && vars.REGISTRY || '' }}
|
REGISTRY: ${{ vars.REGISTRY != '' && vars.REGISTRY || '' }}
|
||||||
|
BUILD_ARM64: ${{ vars.BUILD_ARM64 != 'false' && 'true' || 'false' }}
|
||||||
DOCKERHUB_SLUG: arabcoders/ytptube
|
DOCKERHUB_SLUG: arabcoders/ytptube
|
||||||
GHCR_SLUG: ghcr.io/arabcoders/ytptube
|
GHCR_SLUG: ghcr.io/arabcoders/ytptube
|
||||||
PNPM_VERSION: 10
|
PNPM_VERSION: 10
|
||||||
|
|
@ -131,6 +132,9 @@ jobs:
|
||||||
arch: amd64
|
arch: amd64
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
enabled: ${{ vars.BUILD_ARM64 != 'false' }}
|
||||||
|
exclude:
|
||||||
|
- enabled: false
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: write
|
contents: write
|
||||||
|
|
@ -277,10 +281,16 @@ jobs:
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
for tag in $(echo "${{ steps.meta.outputs.tags }}"); do
|
for tag in $(echo "${{ steps.meta.outputs.tags }}"); do
|
||||||
echo "Creating manifest for ${tag}"
|
echo "Creating manifest for ${tag}"
|
||||||
docker buildx imagetools create \
|
if [ "${{ env.BUILD_ARM64 }}" = "true" ]; then
|
||||||
--tag "$tag" \
|
docker buildx imagetools create \
|
||||||
"${tag}-amd64" \
|
--tag "$tag" \
|
||||||
"${tag}-arm64"
|
"${tag}-amd64" \
|
||||||
|
"${tag}-arm64"
|
||||||
|
else
|
||||||
|
docker buildx imagetools create \
|
||||||
|
--tag "$tag" \
|
||||||
|
"${tag}-amd64"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
- name: Overwrite GitHub release notes
|
- name: Overwrite GitHub release notes
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue