Skip to content

Commit

Permalink
🏗️ config(cd): Add GHA workflows to build backup images.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Feb 3, 2025
1 parent faff141 commit 7c54361
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/ci:build:image:backup-retention-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci:build:image:backup-retention-policy

on:
push:
tags:
- v*
branches:
- main
pull_request:
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/patient-backup-retention-policy

jobs:

build:
name: Continuous integration (build image backup-retention-policy)
strategy:
matrix:
platform:
- ubuntu-latest

runs-on: ${{ matrix.platform }}

timeout-minutes: 15

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Log in to GitHub Packages registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and publish
uses: ./.github/actions/package/build-publish
with:
context: .deploy/backup-retention-policy
package: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
48 changes: 48 additions & 0 deletions .github/workflows/ci:build:image:backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci:build:image:backup

on:
push:
tags:
- v*
branches:
- main
pull_request:
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/patient-backup

jobs:

build:
name: Continuous integration (build image backup)
strategy:
matrix:
platform:
- ubuntu-latest

runs-on: ${{ matrix.platform }}

timeout-minutes: 15

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Log in to GitHub Packages registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Build and publish
uses: ./.github/actions/package/build-publish
with:
context: .deploy/backup
package: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
2 changes: 1 addition & 1 deletion .github/workflows/container-retention-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Cleanup old non-release images 🧹
uses: dataaxiom/ghcr-cleanup-action@v1
with:
packages: ${{ github.repository_owner }}/patient-web
packages: ${{ github.repository_owner }}/patient-web,${{ github.repository_owner }}/patient-backup,${{ github.repository_owner }}/patient-backup-retention-policy
dry-run: ${{ inputs.dry-run || false }}
older-than: ${{ inputs.older-than || '1 month' }}
delete-tags: sha-*,pr-*,gh-readonly-queue-*
Expand Down

0 comments on commit 7c54361

Please sign in to comment.