Skip to content

Commit

Permalink
Use env variables instead of inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
tskarhed committed May 13, 2023
1 parent edb16fb commit c1822db
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions .github/workflows/build-pages.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
# This is a basic workflow to help you get started with Actions

name: Build and Publish to Github pages
inputs:
name:
description: "Artifact name"
required: false
default: "github-pages"
path:
description: "Path of the directory containing the static assets."
required: true
default: "_site/"
retention-days:
description: "Duration after which artifact will expire in days."
required: false
default: "1"
env:
INPUT_PATH: "_site/"
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
Expand Down Expand Up @@ -51,7 +40,11 @@ jobs:
run: |
cd songs
for dir in */; do
(cd $dir && ../../lilypond-2.24.1/bin/lilypond --svg main.ly)
(cd $dir &&
if test -f "main.ly"; then
../../lilypond-2.24.1/bin/lilypond --svg main.ly
fi
)
done
- name: Generate .md files for eleventy
Expand All @@ -60,22 +53,20 @@ jobs:
run: npm run build:11ty --pathPrefix=scores-ly
- name: Build artifact archive
run: |
chmod -c -R +rX "$INPUT_PATH" | while read line; do
chmod -c -R +rX "$env.INPUT_PATH" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
--directory "env.$INPUT_PATH" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
env:
INPUT_PATH: ${{ inputs.path }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.name }}
name: "github-pages"
path: ${{ runner.temp }}/artifact.tar
retention-days: ${{ inputs.retention-days }}
retention-days: 1
if-no-files-found: error

0 comments on commit c1822db

Please sign in to comment.