-
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.
feat: add bake build and beta releases
- Loading branch information
Showing
8 changed files
with
178 additions
and
69 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
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,23 @@ | ||
name: 🧹 Release PR Cleanup | ||
|
||
on: | ||
schedule: | ||
- cron: 0 0 * * 0 # Every Sunday at 00:00 UTC | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release-pr-cleanup: | ||
runs-on: ubuntu-22.04 | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: ovsds/package-lifecycle-action@v1 | ||
with: | ||
package-name: ${{ github.event.repository.name }}-beta | ||
expire-period-days: 7 | ||
untagged: true | ||
retained-tagged-top: 1 | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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,76 @@ | ||
name: Release PR | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
release-pr: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Environment | ||
uses: ./.github/actions/setup_environment | ||
with: | ||
with-python: "false" | ||
with-poetry: "false" | ||
|
||
- name: Get Image Data | ||
id: get-image-data | ||
run: | | ||
echo "registry=ghcr.io/${{ github.repository_owner }}" >> $GITHUB_OUTPUT | ||
echo "name=${{ github.event.repository.name }}-beta" >> $GITHUB_OUTPUT | ||
echo "tag=${{ github.event.number }}-${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Configure Docker Builder | ||
run: task configure-builder | ||
|
||
- name: Build backend images | ||
working-directory: backend | ||
env: | ||
IMAGE_REGISTRY: ${{ steps.get-image-data.outputs.registry }} | ||
IMAGE_NAME: ${{ steps.get-image-data.outputs.name }} | ||
IMAGE_TAG: ${{ steps.get-image-data.outputs.tag }} | ||
run: | | ||
task ci-image-push | ||
- name: Scan backend image | ||
id: scan | ||
uses: ovsds/run-with-output-action@v1 | ||
continue-on-error: true | ||
with: | ||
run: | | ||
task backend:ci-image-scan \ | ||
IMAGE_REGISTRY="${{ steps.get-image-data.outputs.registry }}" \ | ||
IMAGE_NAME="${{ steps.get-image-data.outputs.name }}" \ | ||
IMAGE_TAG="${{ steps.get-image-data.outputs.tag }}" | ||
- name: Report vulnerabilities | ||
uses: ovsds/create-or-update-unique-comment-action@v1 | ||
with: | ||
issue-number: ${{ github.event.number }} | ||
body: | | ||
## Vulnerabilities found | ||
``` | ||
${{ steps.scan.outputs.stdout }} | ||
``` | ||
unique-body-includes: "## Vulnerabilities found" | ||
delete: ${{ steps.scan.outputs.exit_code == 0 }} |
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
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
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
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
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,45 @@ | ||
variable "IMAGE_REGISTRY" {} | ||
variable "IMAGE_NAME" { default = "github-watcher" } | ||
variable "IMAGE_TAG" {} | ||
variable "PLATFORMS" { | ||
default = [ | ||
"linux/amd64", | ||
"linux/arm64", | ||
] | ||
} | ||
|
||
target "base" { | ||
dockerfile = "Dockerfile" | ||
contexts = { | ||
"base_builder" = "docker-image://docker.io/library/python:3.12.7-bookworm" | ||
"base_runtime" = "docker-image://docker.io/library/python:3.12.7-slim-bookworm" | ||
"sources" = "." | ||
} | ||
} | ||
|
||
target "runtime" { | ||
inherits = ["base"] | ||
target = "runtime" | ||
tags = ["${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}"] | ||
output = ["type=image,push=true"] | ||
platforms = PLATFORMS | ||
attest = [ | ||
"type=provenance,mode=max", | ||
"type=sbom", | ||
] | ||
} | ||
|
||
target "runtime_docker" { | ||
inherits = ["base"] | ||
target = "runtime" | ||
output = ["type=docker"] | ||
tags = ["${IMAGE_NAME}:runtime"] | ||
} | ||
|
||
target "tests_docker" { | ||
inherits = ["base"] | ||
output = ["type=docker"] | ||
tags = ["${IMAGE_NAME}:tests"] | ||
target = "tests" | ||
} | ||
|