-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add GitHub Action for Docker build
Based on our own reusable GitHub workflows for Docker from: - tiacsys/github-workflows/.github/workflows/docker-stages.yml@main - tiacsys/github-workflows/.github/workflows/docker-retention.yml@main Use our own reusable GitHub workflows for Retry on Failure from: - tiacsys/github-workflows/.github/workflows/retry-workflow.yml@main Signed-off-by: Stephan Linz <[email protected]>
- Loading branch information
Showing
7 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"include": [ | ||
{ "platform": "linux/amd64" }, | ||
{ "platform": "linux/arm/v7" }, | ||
{ "platform": "linux/arm64/v8" }, | ||
{ "platform": "linux/riscv64" }, | ||
{ "platform": "linux/ppc64le" }, | ||
{ "platform": "linux/s390x" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"include": [ | ||
{ "stage": "base" }, | ||
{ "stage": "push", "ghr-free-disk": false } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Clean Buildcache | ||
|
||
on: | ||
workflow_dispatch: # Manually on button click | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
|
||
# Delete the "buildcache-*" tagged Docker images on demand. | ||
uses: tiacsys/github-workflows/.github/workflows/docker-mr-proper.yml@main | ||
with: | ||
delete-tags: buildcache-* | ||
secrets: inherit # pass all secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Docker | ||
|
||
on: | ||
schedule: | ||
# every day at 01:00 UTC | ||
# https://crontab.guru/#0_1_*_*_* | ||
- cron: '0 1 * * *' | ||
push: | ||
branches: | ||
- 'main' | ||
# Publish calver or pep440 tags as releases. | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' | ||
paths: | ||
- '.github/workflows/docker-publish.yml' | ||
- '.github/workflows/retry-workflow.yml' | ||
- '.github/platforms.json' | ||
- '.github/stages.json' | ||
- '.dockerignore' | ||
- 'Dockerfile' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
paths: | ||
- '.github/workflows/docker-publish.yml' | ||
- '.github/workflows/retry-workflow.yml' | ||
- '.github/platforms.json' | ||
- '.github/stages.json' | ||
- '.dockerignore' | ||
- 'Dockerfile' | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
|
||
# Build all multi-platform Docker images, all stages. The specified | ||
# stages (in ./.github/stages.json) are built one after the other | ||
# for the specified platforms (in ./.github/platforms.json) and, | ||
# if successful, are finally merged via a Docker manifest and | ||
# published to the Docker registry on GitHub. | ||
uses: tiacsys/github-workflows/.github/workflows/docker-stages.yml@main | ||
with: | ||
ghr-free-disk: false | ||
platforms-json: ./.github/platforms.json | ||
stages-json: ./.github/stages.json | ||
secrets: inherit # pass all secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: PR Close Policy | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
|
||
# Delete the "pr-#" tagged Docker images when a pull request is closed. | ||
uses: tiacsys/github-workflows/.github/workflows/docker-mr-proper.yml@main | ||
with: | ||
delete-tags: pr-${{github.event.pull_request.number}} | ||
secrets: inherit # pass all secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Retention Policy | ||
|
||
on: | ||
workflow_dispatch: # And manually on button click | ||
schedule: | ||
# every day at 00:05 UTC | ||
- cron: '5 0 * * *' | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
|
||
# Delete all untagged Docker images older than 2 weeks. | ||
uses: tiacsys/github-workflows/.github/workflows/docker-retention.yml@main | ||
with: | ||
older-than: 2 weeks | ||
exclude-tags: "^\\d+\\.\\d+\\.\\d+$|^latest$|^main$|^nightly$" | ||
secrets: inherit # pass all secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Retry Workflow | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
runid: | ||
required: true | ||
|
||
jobs: | ||
fail: | ||
name: Fail | ||
|
||
uses: tiacsys/github-workflows/.github/workflows/retry-workflow.yml@main | ||
with: | ||
runid: ${{ inputs.runid }} |