Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea70a2eb33 |
+13
-13
@@ -9,13 +9,6 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# registry + cosign creds via env, NOT inline ${{ }}: the Harbor robot
|
|
||||||
# username contains '$', which sh expands when interpolated into the
|
|
||||||
# script (robot$ci-push -> robot-push) => docker login unauthorized.
|
|
||||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
COSIGN_KEY: ${{ secrets.COSIGN_KEY }}
|
|
||||||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
|
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
RUSTFLAGS: "-D warnings"
|
RUSTFLAGS: "-D warnings"
|
||||||
# sccache caches compilation artifacts within a job so that compiling
|
# sccache caches compilation artifacts within a job so that compiling
|
||||||
@@ -280,12 +273,19 @@ jobs:
|
|||||||
git checkout FETCH_HEAD
|
git checkout FETCH_HEAD
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
run: |
|
run: |
|
||||||
IMAGE=repo.breakpilot.com/certifai/certifai-dashboard
|
IMAGE=registry.meghsakha.com/certifai-dashboard
|
||||||
echo "$REGISTRY_PASSWORD" | \
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | \
|
||||||
docker login repo.breakpilot.com -u "$REGISTRY_USERNAME" --password-stdin
|
docker login registry.meghsakha.com -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
||||||
docker build -t "$IMAGE:latest" -t "$IMAGE:${GITHUB_SHA}" .
|
docker build -t "$IMAGE:latest" -t "$IMAGE:${GITHUB_SHA}" .
|
||||||
docker push "$IMAGE:latest"
|
docker push "$IMAGE:latest"
|
||||||
{ command -v cosign >/dev/null 2>&1 || curl -sSfLo /usr/local/bin/cosign https://github.com/sigstore/cosign/releases/download/v2.4.3/cosign-linux-amd64 || wget -qO /usr/local/bin/cosign https://github.com/sigstore/cosign/releases/download/v2.4.3/cosign-linux-amd64; } || echo "::warning::cosign fetch failed"
|
|
||||||
chmod +x /usr/local/bin/cosign 2>/dev/null || true
|
|
||||||
cosign sign --yes --key env://COSIGN_KEY "$IMAGE:latest" || echo "::warning::cosign failed"
|
|
||||||
docker push "$IMAGE:${GITHUB_SHA}"
|
docker push "$IMAGE:${GITHUB_SHA}"
|
||||||
|
- name: Trigger orca redeploy
|
||||||
|
run: |
|
||||||
|
PAYLOAD=$(printf '{"ref":"refs/heads/main","repository":{"full_name":"sharang/certifai"},"head_commit":{"id":"%s","message":"CI deploy"}}' "${GITHUB_SHA}")
|
||||||
|
SIG=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "${{ secrets.ORCA_WEBHOOK_SECRET }}" | awk '{print $2}')
|
||||||
|
echo "Calling orca webhook for sharang/certifai@${GITHUB_SHA}"
|
||||||
|
RESP=$(curl -fsS -w "\nHTTP %{http_code}" -X POST "http://46.225.100.82:6880/api/v1/webhooks/github" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "X-Hub-Signature-256: sha256=$SIG" \
|
||||||
|
-d "$PAYLOAD")
|
||||||
|
echo "$RESP"
|
||||||
Reference in new issue
Block a user