mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-12 10:33:49 +00:00
Merge pull request #705 from acelaya-forks/feature/refactor-docker-build
Moved to docker build from reusable workflow
This commit is contained in:
3
.github/workflows/docker-image-build.yml
vendored
3
.github/workflows/docker-image-build.yml
vendored
@@ -12,4 +12,5 @@ jobs:
|
|||||||
uses: shlinkio/github-actions/.github/workflows/docker-build-and-publish.yml@main
|
uses: shlinkio/github-actions/.github/workflows/docker-build-and-publish.yml@main
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
build-and-publish-script: bash ./scripts/docker/build
|
image-name: shlinkio/shlink-web-client
|
||||||
|
version-arg-name: VERSION
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
PLATFORMS="linux/arm/v7,linux/arm64/v8,linux/amd64"
|
|
||||||
DOCKER_IMAGE="shlinkio/shlink-web-client"
|
|
||||||
|
|
||||||
if [[ "$GITHUB_REF" == *"develop"* ]]; then
|
|
||||||
docker buildx build --push \
|
|
||||||
--platform ${PLATFORMS} \
|
|
||||||
-t ${DOCKER_IMAGE}:latest -t ghcr.io/${DOCKER_IMAGE}:latest .
|
|
||||||
|
|
||||||
# If ref is not develop, then this is a tag. Build that docker tag and also "stable"
|
|
||||||
else
|
|
||||||
VERSION=${GITHUB_REF#refs/tags/v}
|
|
||||||
TAGS="-t ${DOCKER_IMAGE}:${VERSION} -t ghcr.io/${DOCKER_IMAGE}:${VERSION}"
|
|
||||||
|
|
||||||
# Push stable tag only if this is not an alpha or beta release
|
|
||||||
[[ $GITHUB_REF != *"alpha"* && $GITHUB_REF != *"beta"* ]] && TAGS="${TAGS} -t ${DOCKER_IMAGE}:stable -t ghcr.io/${DOCKER_IMAGE}:stable"
|
|
||||||
|
|
||||||
docker buildx build --push \
|
|
||||||
--build-arg VERSION=${VERSION} \
|
|
||||||
--platform ${PLATFORMS} \
|
|
||||||
${TAGS} .
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user