Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a6190a805 | |||
| a2d18c18d8 | |||
| b5151db0ac | |||
| 5cd46571f2 | |||
| 9c4f9b95a9 | |||
| e22010a907 | |||
| 5cdb4c63b8 | |||
| 4819d9c7ac | |||
| 1233d80c8f | |||
| 89fb02cdea | |||
| 76254d0dbb | |||
| c4536afa5f | |||
| 72f2568b68 | |||
| 8a49fc57f1 | |||
| a0be839632 | |||
| d5c5d2b6ba | |||
| 0977a7c3b3 | |||
| 21fba7a842 |
+29
-19
@@ -37,17 +37,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
DATE_TAG=$(date -u +%Y.%m.%d)
|
DATE_TAG=$(date -u +%Y.%m.%d)
|
||||||
EXISTING=$(git tag -l "v${DATE_TAG}*" | sort -V | tail -1)
|
EXISTING=$(git tag -l "v${DATE_TAG}*" | sort -V | tail -1)
|
||||||
if [ -z "$EXISTING" ]; then VERSION="$DATE_TAG"
|
if [ -z "$EXISTING" ]; then
|
||||||
elif [ "$EXISTING" = "v${DATE_TAG}" ]; then VERSION="${DATE_TAG}.2"
|
VERSION="$DATE_TAG"
|
||||||
else BUILD_NUM=$(echo "$EXISTING" | sed "s/v${DATE_TAG}\.//"); VERSION="${DATE_TAG}.$((BUILD_NUM + 1))"; fi
|
elif [ "$EXISTING" = "v${DATE_TAG}" ]; then
|
||||||
|
VERSION="${DATE_TAG}.2"
|
||||||
|
else
|
||||||
|
BUILD_NUM=$(echo "$EXISTING" | sed "s/v${DATE_TAG}\.//"); VERSION="${DATE_TAG}.$((BUILD_NUM + 1))";
|
||||||
|
fi
|
||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Log in to Gitea Container Registry
|
- name: Log in to Gitea Container Registry
|
||||||
uses: docker/login-action@v3
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ env.REGISTRY }} -u "${{ github.actor }}" --password-stdin
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata
|
- name: Extract metadata
|
||||||
id: meta
|
id: meta
|
||||||
@@ -59,11 +59,21 @@ jobs:
|
|||||||
type=raw,value=${{ steps.calver.outputs.version }},enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=${{ steps.calver.outputs.version }},enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build Docker image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
load: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
- name: Push Docker image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
|
provenance: false
|
||||||
|
sbom: false
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
@@ -82,7 +92,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: cartsnitch/infra
|
repository: cartsnitch/infra
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
token: ${{ secrets.CI_GITEA_TOKEN }}
|
||||||
ref: main
|
ref: main
|
||||||
path: infra
|
path: infra
|
||||||
|
|
||||||
@@ -116,7 +126,7 @@ jobs:
|
|||||||
- name: Commit and push to infra (via PR)
|
- name: Commit and push to infra (via PR)
|
||||||
if: needs.build-and-push.result == 'success'
|
if: needs.build-and-push.result == 'success'
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd infra
|
cd infra
|
||||||
@@ -135,7 +145,7 @@ jobs:
|
|||||||
PR_BODY=$(jq -n --arg head "$BRANCH" --arg body "Bumps apps/overlays/dev/kustomization.yaml auth newTag to \`${{ steps.tag.outputs.tag }}\` from cartsnitch/auth CI build $GITHUB_SHA." \
|
PR_BODY=$(jq -n --arg head "$BRANCH" --arg body "Bumps apps/overlays/dev/kustomization.yaml auth newTag to \`${{ steps.tag.outputs.tag }}\` from cartsnitch/auth CI build $GITHUB_SHA." \
|
||||||
'{head: $head, base: "main", title: ("ci(dev): update auth image (" + env.GITHUB_SHA[:12] + ")"), body: $body}')
|
'{head: $head, base: "main", title: ("ci(dev): update auth image (" + env.GITHUB_SHA[:12] + ")"), body: $body}')
|
||||||
PR_JSON=$(curl -sS -X POST \
|
PR_JSON=$(curl -sS -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${CI_GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "$PR_BODY" \
|
-d "$PR_BODY" \
|
||||||
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls")
|
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls")
|
||||||
@@ -146,7 +156,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "Opened cartsnitch/infra PR #${PR_NUM}"
|
echo "Opened cartsnitch/infra PR #${PR_NUM}"
|
||||||
REVIEW_HTTP=$(curl -sS -o /dev/null -w '%{http_code}' -X POST \
|
REVIEW_HTTP=$(curl -sS -o /dev/null -w '%{http_code}' -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${CI_GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"reviewers":["cs_savannah"]}' \
|
-d '{"reviewers":["cs_savannah"]}' \
|
||||||
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls/${PR_NUM}/requested_reviewers")
|
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls/${PR_NUM}/requested_reviewers")
|
||||||
@@ -154,7 +164,7 @@ jobs:
|
|||||||
echo "::notice::Failed to request reviewers for cartsnitch/infra PR #${PR_NUM} (HTTP ${REVIEW_HTTP}); continuing"
|
echo "::notice::Failed to request reviewers for cartsnitch/infra PR #${PR_NUM} (HTTP ${REVIEW_HTTP}); continuing"
|
||||||
fi
|
fi
|
||||||
MERGE_RESP=$(curl -sS -X POST \
|
MERGE_RESP=$(curl -sS -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${CI_GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"Do":"merge","delete_branch_after_merge":true}' \
|
-d '{"Do":"merge","delete_branch_after_merge":true}' \
|
||||||
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls/${PR_NUM}/merge")
|
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls/${PR_NUM}/merge")
|
||||||
@@ -181,7 +191,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: cartsnitch/infra
|
repository: cartsnitch/infra
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
token: ${{ secrets.CI_GITEA_TOKEN }}
|
||||||
ref: main
|
ref: main
|
||||||
path: infra
|
path: infra
|
||||||
|
|
||||||
@@ -215,7 +225,7 @@ jobs:
|
|||||||
- name: Commit and push to infra (via PR)
|
- name: Commit and push to infra (via PR)
|
||||||
if: needs.build-and-push.result == 'success'
|
if: needs.build-and-push.result == 'success'
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
CI_GITEA_TOKEN: ${{ secrets.CI_GITEA_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd infra
|
cd infra
|
||||||
@@ -234,7 +244,7 @@ jobs:
|
|||||||
PR_BODY=$(jq -n --arg head "$BRANCH" --arg body "Bumps apps/overlays/uat/kustomization.yaml auth newTag to \`${{ steps.tag.outputs.tag }}\` from cartsnitch/auth CI build $GITHUB_SHA." \
|
PR_BODY=$(jq -n --arg head "$BRANCH" --arg body "Bumps apps/overlays/uat/kustomization.yaml auth newTag to \`${{ steps.tag.outputs.tag }}\` from cartsnitch/auth CI build $GITHUB_SHA." \
|
||||||
'{head: $head, base: "main", title: ("ci(uat): update auth image (" + env.GITHUB_SHA[:12] + ")"), body: $body}')
|
'{head: $head, base: "main", title: ("ci(uat): update auth image (" + env.GITHUB_SHA[:12] + ")"), body: $body}')
|
||||||
PR_JSON=$(curl -sS -X POST \
|
PR_JSON=$(curl -sS -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${CI_GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "$PR_BODY" \
|
-d "$PR_BODY" \
|
||||||
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls")
|
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls")
|
||||||
@@ -245,7 +255,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "Opened cartsnitch/infra PR #${PR_NUM}"
|
echo "Opened cartsnitch/infra PR #${PR_NUM}"
|
||||||
REVIEW_HTTP=$(curl -sS -o /dev/null -w '%{http_code}' -X POST \
|
REVIEW_HTTP=$(curl -sS -o /dev/null -w '%{http_code}' -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${CI_GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"reviewers":["cs_savannah"]}' \
|
-d '{"reviewers":["cs_savannah"]}' \
|
||||||
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls/${PR_NUM}/requested_reviewers")
|
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls/${PR_NUM}/requested_reviewers")
|
||||||
@@ -253,7 +263,7 @@ jobs:
|
|||||||
echo "::notice::Failed to request reviewers for cartsnitch/infra PR #${PR_NUM} (HTTP ${REVIEW_HTTP}); continuing"
|
echo "::notice::Failed to request reviewers for cartsnitch/infra PR #${PR_NUM} (HTTP ${REVIEW_HTTP}); continuing"
|
||||||
fi
|
fi
|
||||||
MERGE_RESP=$(curl -sS -X POST \
|
MERGE_RESP=$(curl -sS -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${CI_GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"Do":"merge","delete_branch_after_merge":true}' \
|
-d '{"Do":"merge","delete_branch_after_merge":true}' \
|
||||||
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls/${PR_NUM}/merge")
|
"https://git.farh.net/api/v1/repos/cartsnitch/infra/pulls/${PR_NUM}/merge")
|
||||||
|
|||||||
Reference in New Issue
Block a user