A dependency-free node20 action that triggers application.deploy or compose.deploy, then follows the deployment to a terminal status so a failed build fails the CI run. Snapshots the deployment list before triggering, so a concurrent deployment is never mistaken for this one. Optionally points the application at a freshly built image first, which is what lets a workflow lint, test, push and deploy the same artifact.
34 lines
810 B
YAML
34 lines
810 B
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*.*.*"]
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
# Workflows pin `@v1`, so the major tag has to follow each release.
|
|
major-tag:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Test before moving the tag
|
|
run: node --test
|
|
|
|
- name: Move the major version tag
|
|
run: |
|
|
major="${GITHUB_REF_NAME%%.*}"
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git tag -f "$major" "$GITHUB_REF_NAME"
|
|
git push origin "refs/tags/$major" --force
|
|
echo "Moved $major to $GITHUB_REF_NAME"
|