-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
34 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build | ||
name: Generate | ||
|
||
on: | ||
pull_request: | ||
|
@@ -12,13 +12,13 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
generate: | ||
name: Generate image files from source | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
# Ref is required if auto-commit action is used in pull requests. | ||
# https://github.com/stefanzweifel/git-auto-commit-action#checkout-the-correct-branch | ||
|
@@ -32,17 +32,17 @@ jobs: | |
with: | ||
deno-version: "^1" | ||
|
||
- name: Run build | ||
- name: Run generator script | ||
run: deno task start | ||
|
||
- name: Auto-commit changed files | ||
# Automatically commit files which have been changed during the workflow run and push changes back | ||
# to remote repository. | ||
# https://github.com/stefanzweifel/git-auto-commit-action | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: 'build: rRRR!' | ||
commit_message: 'GenerRRRRR-ate image files from source!' | ||
commit_user_name: 'FriendsOfREDAXO-T' | ||
commit_user_email: '[email protected]' | ||
commit_author: 'FriendsOfREDAXO-T <[email protected]>' | ||
file_pattern: 'builds/**/*' | ||
file_pattern: 'images/**/*' |
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,58 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- 'images/**/*' | ||
# add workflow dispatch to manually publish the current images | ||
workflow_dispatch | ||
|
||
concurrency: | ||
# Cancel in-progress jobs if a new job is trigged by a commit from the same branch | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
collect: | ||
name: Collect images from directories | ||
runs-on: ubuntu-latest | ||
outputs: | ||
IMAGES: ${{ steps.images.outputs.directories }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Collect images from directories | ||
id: images | ||
run: | | ||
# install tree and jq | ||
sudo apt update && sudo apt install -y tree jq | ||
# change to images directory | ||
cd images | ||
# collect images | ||
echo "directories=$(tree -J -d -L 1 | jq -c '.[0].contents | map(.name)')" >> $GITHUB_OUTPUT | ||
|
||
publish: | ||
name: Publish images | ||
runs-on: ubuntu-latest | ||
needs: [collect] | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: ${{ fromJson(needs.collect.outputs.IMAGES) }} | ||
platform: | ||
- linux/amd64 | ||
- linux/arm64 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false |
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