-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ci): Use docker/login-action to log in to container registries
- Loading branch information
1 parent
7aa5e57
commit cdd9cbd
Showing
3 changed files
with
39 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,27 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -eux | ||
|
||
APK_FILE="$1" | ||
TAG="$2" | ||
USER="$3" | ||
PASSWORD="$4" | ||
ARCHITECTURE="$5" | ||
ARCHITECTURE="$3" | ||
|
||
cp "$APK_FILE" . | ||
|
||
if [ "${PUBLISH_DOCKER_IMAGE}" = "true" ]; then | ||
PUSH_OPTION=--push | ||
fi | ||
|
||
# shellcheck disable=SC2086 | ||
docker build \ | ||
--pull \ | ||
--no-cache \ | ||
--provenance false \ | ||
--build-arg "APK_FILE=$APK_FILE" \ | ||
--file .github/docker/alpine.dockerfile \ | ||
--tag "savonet/liquidsoap-ci-build:${TAG}_alpine_${ARCHITECTURE}" \ | ||
${PUSH_OPTION} \ | ||
. | ||
|
||
if [ "${PUBLISH_DOCKER_IMAGE}" != "true" ]; then | ||
exit 0 | ||
fi | ||
|
||
docker login -u "$USER" -p "$PASSWORD" | ||
|
||
docker pull "savonet/liquidsoap-ci-build:${TAG}_alpine_${ARCHITECTURE}" | ||
|
||
docker tag \ | ||
"savonet/liquidsoap-ci-build:${TAG}_alpine_${ARCHITECTURE}" \ | ||
"ghcr.io/savonet/liquidsoap-ci-build:${TAG}_alpine_${ARCHITECTURE}" | ||
|
||
docker push "savonet/liquidsoap-ci-build:${TAG}_alpine_${ARCHITECTURE}" | ||
docker push "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_alpine_${ARCHITECTURE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,31 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -eux | ||
|
||
DEB_FILE="$1" | ||
DEB_DEBUG_FILE="$2" | ||
TAG="$3" | ||
USER="$4" | ||
PASSWORD="$5" | ||
ARCHITECTURE="$6" | ||
ARCHITECTURE="$4" | ||
|
||
cp "$DEB_FILE" "$DEB_DEBUG_FILE" . | ||
|
||
DOCKERFILE=.github/docker/debian.dockerfile | ||
|
||
if [ "${PUBLISH_DOCKER_IMAGE}" = "true" ]; then | ||
PUSH_OPTION=--push | ||
fi | ||
|
||
# shellcheck disable=SC2086 | ||
docker build \ | ||
--pull \ | ||
--no-cache \ | ||
--provenance false \ | ||
--build-arg "DEB_FILE=$DEB_FILE" \ | ||
--build-arg "DEB_DEBUG_FILE=$DEB_DEBUG_FILE" \ | ||
--file "${DOCKERFILE}" \ | ||
--file .github/docker/debian.dockerfile \ | ||
--tag "savonet/liquidsoap-ci-build:${TAG}_${ARCHITECTURE}" \ | ||
${PUSH_OPTION} \ | ||
. | ||
|
||
docker push "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_${ARCHITECTURE}" | ||
|
||
if [ "${PUBLISH_DOCKER_IMAGE}" != "true" ]; then | ||
exit 0 | ||
fi | ||
|
||
docker login -u "$USER" -p "$PASSWORD" | ||
|
||
docker pull "savonet/liquidsoap-ci-build:${TAG}_${ARCHITECTURE}" | ||
|
||
docker tag \ | ||
"savonet/liquidsoap-ci-build:${TAG}_${ARCHITECTURE}" \ | ||
"ghcr.io/savonet/liquidsoap-ci-build:${TAG}_${ARCHITECTURE}" | ||
|
||
docker push "savonet/liquidsoap-ci-build:${TAG}_${ARCHITECTURE}" | ||
docker push "ghcr.io/savonet/liquidsoap-ci-build:${TAG}_${ARCHITECTURE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters