generated from coulomb/repo-seed
fix(ci): publish images with registry bearer token
Some checks failed
Build and Deploy / build-push-deploy (push) Failing after 38s
Some checks failed
Build and Deploy / build-push-deploy (push) Failing after 38s
This commit is contained in:
@@ -17,6 +17,7 @@ jobs:
|
|||||||
- name: Build OCI image
|
- name: Build OCI image
|
||||||
shell: bash -l {0}
|
shell: bash -l {0}
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
nix build .#docker \
|
nix build .#docker \
|
||||||
--accept-flake-config \
|
--accept-flake-config \
|
||||||
--option lazy-trees false \
|
--option lazy-trees false \
|
||||||
@@ -27,14 +28,27 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
SHA=$(git rev-parse --short HEAD)
|
SHA=$(git rev-parse --short HEAD)
|
||||||
skopeo copy docker-archive:result \
|
TOKEN=$(
|
||||||
"docker://gitea.coulomb.social/coulomb/inter-hub:${SHA}" \
|
curl -fsS \
|
||||||
--dest-creds "tegwick:${GITEA_TOKEN}"
|
"https://gitea.coulomb.social/v2/token?service=container_registry&scope=repository:coulomb/inter-hub:push,pull" \
|
||||||
|
-u "tegwick:${GITEA_TOKEN}" \
|
||||||
|
| awk -F'"' '/token/{print $4}'
|
||||||
|
)
|
||||||
|
if [ -z "${TOKEN}" ]; then
|
||||||
|
echo "Failed to obtain Gitea registry token" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
skopeo copy --insecure-policy \
|
||||||
|
--dest-registry-token "${TOKEN}" \
|
||||||
|
docker-archive:result \
|
||||||
|
"docker://gitea.coulomb.social/coulomb/inter-hub:${SHA}"
|
||||||
# Also tag as latest
|
# Also tag as latest
|
||||||
skopeo copy docker-archive:result \
|
skopeo copy --insecure-policy \
|
||||||
"docker://gitea.coulomb.social/coulomb/inter-hub:latest" \
|
--dest-registry-token "${TOKEN}" \
|
||||||
--dest-creds "tegwick:${GITEA_TOKEN}"
|
docker-archive:result \
|
||||||
|
"docker://gitea.coulomb.social/coulomb/inter-hub:latest"
|
||||||
echo "Pushed inter-hub:${SHA} and inter-hub:latest"
|
echo "Pushed inter-hub:${SHA} and inter-hub:latest"
|
||||||
|
|
||||||
- name: Deploy to Railiance01
|
- name: Deploy to Railiance01
|
||||||
@@ -42,6 +56,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
KUBECONFIG: ${{ secrets.RAILIANCE01_KUBECONFIG }}
|
KUBECONFIG: ${{ secrets.RAILIANCE01_KUBECONFIG }}
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
SHA=$(git rev-parse --short HEAD)
|
SHA=$(git rev-parse --short HEAD)
|
||||||
helm upgrade --install inter-hub deploy/helm/inter-hub \
|
helm upgrade --install inter-hub deploy/helm/inter-hub \
|
||||||
--namespace inter-hub --create-namespace \
|
--namespace inter-hub --create-namespace \
|
||||||
@@ -50,6 +65,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Smoke test
|
- name: Smoke test
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
# Give the new pod time to start
|
# Give the new pod time to start
|
||||||
sleep 15
|
sleep 15
|
||||||
curl -sf --retry 5 --retry-delay 5 https://hub.coulomb.social/ \
|
curl -sf --retry 5 --retry-delay 5 https://hub.coulomb.social/ \
|
||||||
|
|||||||
Reference in New Issue
Block a user