Skip to content

Commit

Permalink
add Github Actions workflow for image generation
Browse files Browse the repository at this point in the history
  • Loading branch information
grische authored and maurerle committed Jun 27, 2024
1 parent 49875a3 commit 4edbd66
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 7 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/generate-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Generate Images

on: # yamllint disable-line rule:truthy
workflow_dispatch:
workflow_call:

jobs:
conversion:
name: Generate Images
runs-on: ubuntu-latest
container:
image: linuxserver/inkscape:1.3.2
steps:
- uses: actions/checkout@v4

- name: install dependencies
run: |
apk --no-cache add imagemagick
apk --no-cache add exiftool
- name: convert images
run: |
./conversion-script.sh
- name: package images
shell: bash
run: |
# The tar is required to preserve symlinks
tar cvf device-pictures-jpg.tar README.md pictures-jpg/
tar cvf device-pictures-png.tar README.md pictures-png/
- name: upload JPG archive
uses: actions/upload-artifact@v4
with:
name: device-pictures-jpg.tar
if-no-files-found: error
path: device-pictures-jpg.tar

- name: upload PNG archive
uses: actions/upload-artifact@v4
with:
name: device-pictures-png.tar
if-no-files-found: error
path: device-pictures-png.tar
6 changes: 2 additions & 4 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ name: Shell Linting

on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
paths-ignore:
- '.github/workflows/**'
- '**.svg'
pull_request:
paths-ignore:
- '.github/workflows/**'
- '**.svg'
workflow_call:

jobs:
shellcheck:
Expand All @@ -26,3 +23,4 @@ jobs:
filter_mode: "file"
fail_on_error: true
check_all_files_with_shebangs: true
reporter: github-check
4 changes: 1 addition & 3 deletions .github/workflows/svglint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@

on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
paths:
- '**.svg'
pull_request:
paths:
- '**.svg'
workflow_call:

jobs:
svglint:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/test-and-generate-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
on:
workflow_dispatch:
push:
paths-ignore:
- '.gitignore'
branches:
- main

jobs:
shellcheck:
uses: ./.github/workflows/shellcheck.yml

svglint:
uses: ./.github/workflows/svglint.yml

generate-images:
needs:
- shellcheck
- svglint
uses: ./.github/workflows/generate-images.yml

0 comments on commit 4edbd66

Please sign in to comment.