Repository navigation
ci: build, release and clean up images with the shared org workflows #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6d81438
5f20f04
6e62d29
21b4db3
f2f541b
88cf204
ebabd17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| name: actionlint | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| # Check name: `actionlint / actionlint` | ||
| actionlint: | ||
| uses: Aam-Digital/.github/.github/workflows/actionlint.yml@v1 | ||
| permissions: | ||
| contents: read |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,15 +2,34 @@ name: On Semantic Release (build & publish image) | |
|
|
||
| on: | ||
| release: | ||
| types: [released] | ||
| types: [published] # created with the GH_TOKEN PAT, releases by the GITHUB_TOKEN trigger no workflows | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| # Check names: `build / build (linux/amd64)`, `build / build (linux/arm64)`, `build / merge` | ||
| build: | ||
| uses: ./.github/workflows/_build.yml | ||
| with: | ||
| docker_tags: | | ||
| type=raw,value=${{ github.event.release.tag_name }} | ||
| type=raw,value=latest | ||
| uses: Aam-Digital/.github/.github/workflows/docker-image.yml@v1 | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| with: | ||
| images: ghcr.io/aam-digital/platform-admin-services | ||
| # Tag `<version>` (e.g. `1.7.7`, also the `org.opencontainers.image.version` label); | ||
| # full releases also `stable` and `latest` | ||
| version: ${{ github.event.release.tag_name }} | ||
| stable: ${{ !github.event.release.prerelease }} | ||
| # package.json's version is what the app reports to Sentry | ||
| prepare: npm version "$VERSION" --no-git-tag-version --allow-same-version | ||
|
|
||
| # After a full release, the edge images (`*-edge.*`) of the finished cycle are no longer needed. The image `edge` | ||
| # points to is kept. | ||
| prune-edge-images: | ||
| if: ${{ !github.event.release.prerelease }} | ||
| needs: build | ||
| uses: Aam-Digital/.github/.github/workflows/image-cleanup.yml@v1 | ||
| permissions: | ||
| actions: write | ||
| packages: write | ||
| with: | ||
| tags: "*-edge.*" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Limit pruning to edge images from the completed release cycle. If two main-branch builds publish edge images while the release build runs, this pattern matches both new images. The shared cleanup protects the image currently tagged 🤖 Prompt for AI Agents |
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: On PR closed (delete pre-release image) | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| # Check name: `cleanup-image / cleanup` | ||
| cleanup-image: | ||
| # PRs from forks have no image | ||
| if: github.event.pull_request.head.repo.full_name == github.repository | ||
| uses: Aam-Digital/.github/.github/workflows/image-cleanup.yml@v1 | ||
| permissions: | ||
| actions: write # cancel a still running PR image build, which would otherwise push pr-<n> after the cleanup | ||
| packages: write # the package is linked to this repository, so the job token can delete its versions | ||
| with: | ||
| build-workflows: pr-release.yml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: PR title lint | ||
|
|
||
| on: | ||
| # pull_request_target so that it also runs for PRs from forks. Safe here: the shared workflow never checks out PR code | ||
| # and only reads the PR title from the event payload. | ||
| pull_request_target: # zizmor: ignore[dangerous-triggers] never checks out PR code, only reads the PR title from the event payload | ||
| types: [opened, edited, synchronize, reopened] | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| # Check name: `pr-title / Validate PR title` | ||
| pr-title: | ||
| uses: Aam-Digital/.github/.github/workflows/pr-title-lint.yml@v1 | ||
| permissions: | ||
| pull-requests: read |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 24.22.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "tagFormat": "${version}", | ||
| "plugins": [ | ||
| "@semantic-release/commit-analyzer", | ||
| "@semantic-release/release-notes-generator", | ||
| [ | ||
| "@semantic-release/github", | ||
| { | ||
| "successComment": false, | ||
| "failComment": false, | ||
| "labels": false | ||
| } | ||
| ] | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Prevent an older push from canceling a newer edge build.
If the newer push finishes
testandedge-versionfirst, itsedge-buildcan start before the older push reaches this group. The older job then cancels the newer job and can publish the older commit asedge. GitHub does not guarantee concurrency-group ordering. Serialize without cancellation and check that the commit is still the main-branch head immediately before publishingedge. (docs.github.com)🤖 Prompt for AI Agents