-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: add build action for PRs * ci: use matrix job for build and review * ci: use matrix job for dockerhub description
- Loading branch information
Showing
14 changed files
with
180 additions
and
222 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,37 @@ | ||
name: "image-build-common" | ||
description: "Common runner setup to build Container Images for prind" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "[misc] Clean Runner" | ||
shell: bash | ||
run: | | ||
set -x | ||
## Remove files | ||
to_delete=( | ||
"/swapfile" | ||
"/usr/local/share/boost" | ||
"$AGENT_TOOLSDIRECTORY" | ||
"/usr/share/dotnet" | ||
"$ANDROID_SDK_ROOT" | ||
"/usr/local/lib/android" | ||
"$ANDROID_SDK_ROOT" | ||
"/usr/share/swift" | ||
) | ||
for f in ${to_delete[@]}; do | ||
sudo rm -rf ${f} || true | ||
done | ||
## Clean docker | ||
docker system prune --all --volumes --force | ||
- name: "[docker] set up qemu" | ||
uses: docker/[email protected] | ||
|
||
- name: "[docker] set up buildx" | ||
uses: docker/[email protected] | ||
|
||
- name: "[prind] install requirements" | ||
shell: bash | ||
run: pip install -r scripts/build/requirements.txt |
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,35 @@ | ||
name: 'Build and Publish Images' | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
app: | ||
- klipper | ||
- klipperscreen | ||
- moonraker | ||
- ustreamer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "[prind] checkout" | ||
uses: actions/checkout@v3 | ||
- name: "[prind] set up build environment" | ||
uses: ./.github/actions/image-build-common | ||
- name: "[docker] login" | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: "[prind] build" | ||
run: | | ||
python3 scripts/build/build.py ${{ matrix.app }} \ | ||
--backfill 3 \ | ||
--platform linux/amd64 \ | ||
--platform linux/arm/v6 \ | ||
--platform linux/arm/v7 \ | ||
--platform linux/arm64/v8 \ | ||
--registry docker.io/${{ secrets.DOCKERHUB_USERNAME }} \ | ||
--push |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,57 @@ | ||
name: 'Build Images for Review' | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/image-build-review.yaml | ||
- scripts/build/* | ||
- docker/* | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
apps: ${{ steps.filter.outputs.changes }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
klipper: | ||
- .github/workflows/image-build-review.yaml | ||
- scripts/build/** | ||
- docker/klipper/** | ||
klipperscreen: | ||
- .github/workflows/image-build-review.yaml | ||
- scripts/build/** | ||
- docker/klipperscreen/** | ||
moonraker: | ||
- .github/workflows/image-build-review.yaml | ||
- scripts/build/** | ||
- docker/moonraker/** | ||
ustreamer: | ||
- .github/workflows/image-build-review.yaml | ||
- scripts/build/** | ||
- docker/ustreamer/** | ||
build: | ||
needs: changes | ||
strategy: | ||
matrix: | ||
app: ${{ fromJSON(needs.changes.outputs.apps) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "[prind] checkout" | ||
uses: actions/checkout@v3 | ||
- name: "[prind] set up build environment" | ||
uses: ./.github/actions/image-build-common | ||
- name: "[prind] build" | ||
run: | | ||
python3 scripts/build/build.py ${{ matrix.app }} \ | ||
--backfill 0 \ | ||
--platform linux/amd64 \ | ||
--platform linux/arm/v6 \ | ||
--platform linux/arm/v7 \ | ||
--platform linux/arm64/v8 \ | ||
--force |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
name: "Update Image Description at Dockerhub" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- .github/workflows/image-docs-publish.yaml | ||
- docker/**/README.md | ||
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
outputs: | ||
apps: ${{ steps.filter.outputs.changes }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: | | ||
klipper: | ||
- .github/workflows/image-docs-publish.yaml | ||
- docker/klipper/README.md | ||
klipperscreen: | ||
- .github/workflows/image-docs-publish.yaml | ||
- docker/klipperscreen/README.md | ||
moonraker: | ||
- .github/workflows/image-docs-publish.yaml | ||
- docker/moonraker/README.md | ||
ustreamer: | ||
- .github/workflows/image-docs-publish.yaml | ||
- docker/moonraker/README.md | ||
dockerhub-description: | ||
needs: changes | ||
strategy: | ||
matrix: | ||
app: ${{ fromJSON(needs.changes.outputs.apps) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "Update Docker Hub Description" | ||
uses: peter-evans/dockerhub-description@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
repository: ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.app }} | ||
readme-filepath: ./docker/${{ matrix.app }}/README.md | ||
enable-url-completion: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.