-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for publishing to Github Pages
Github Pages: Build workflow and publish
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 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,83 @@ | ||
# 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" | ||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: ["main"] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# container: | ||
# image: codello/lilypond:2.24.1 | ||
shell: bash | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Setup node | ||
uses: actions/setup-node@v2.5.2 | ||
with: | ||
node-version: 18.12.0 | ||
|
||
# Runs a set of commands using the runners shell | ||
- name: Install node dependencies | ||
run: npm ci | ||
- name: Install Lilypond | ||
run: | | ||
wget https://gitlab.com/lilypond/lilypond/-/releases/v2.24.1/downloads/lilypond-2.24.1-linux-x86_64.tar.gz | ||
tar -xzf lilypond-2.24.1-linux-x86_64.tar.gz | ||
- name: Build lilypond artifacts | ||
run: | | ||
cd songs | ||
for dir in */; do | ||
(cd $dir && ../../lilypond-2.24.1/bin/lilypond --svg main.ly) | ||
done | ||
- name: Generate .md files for eleventy | ||
run: npm run build:pre-11ty | ||
- name: Build eleventy | ||
run: npm run build:11ty --pathPrefix=scores-ly | ||
- name: Build artifact archive | ||
run: | | ||
chmod -c -R +rX "$INPUT_PATH" | while read line; do | ||
echo "::warning title=Invalid file permissions automatically fixed::$line" | ||
done | ||
tar \ | ||
--dereference --hard-dereference \ | ||
--directory "$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 }} | ||
path: ${{ runner.temp }}/artifact.tar | ||
retention-days: ${{ inputs.retention-days }} | ||
if-no-files-found: error |
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,3 +1,4 @@ | ||
#!/bin/bash | ||
cd songs | ||
|
||
for dir in */; do | ||
|