Error handling works. #12
Workflow file for this run
This file contains hidden or 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
name: Deploy to GitHub Pages | |
on: | |
push: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare Packs for Signing | |
env: | |
SIGNIFY_PUBLIC_KEY: ${{ vars.SIGNIFY_PUBLIC_KEY }} | |
run: | | |
fail=0 | |
for pack in packs/*; do | |
[[ -d $pack ]] || continue | |
if grep -q '; public_key' "$pack/unsup.ini"; then | |
sed -i "s|; public_key.*|public_key=signify $SIGNIFY_PUBLIC_KEY|" "$pack/unsup.ini" | |
else | |
echo "::error file=$pack/unsup.ini::Missing public key placeholder for $(basename "$pack")." | |
fail=1 | |
fi | |
done | |
if [[ $fail = 1 ]]; then | |
exit 1 | |
fi | |
- name: Install Signify | |
run: sudo apt-get install -y signify-openbsd | |
- name: Sign Packs | |
env: | |
SIGNIFY_PRIVATE_KEY: ${{ secrets.SIGNIFY_PRIVATE_KEY }} | |
SIGNIFY_PRIVATE_KEY_PASSWORD: ${{ secrets.SIGNIFY_PRIVATE_KEY_PASSWORD }} | |
run: | | |
echo "$SIGNIFY_PRIVATE_KEY" > "$RUNNER_TEMP/signify.sec" | |
fail=0 | |
for pack in packs/*; do | |
[[ -d $pack ]] || continue | |
if ! echo "$SIGNIFY_PRIVATE_KEY_PASSWORD" | signify-openbsd -S -x "$pack/unsup.sig" -s "$RUNNER_TEMP/signify.sec" -m "$pack/pack.toml"; then | |
echo "::error file=$pack/pack.toml::Failed to sign $(basename "$pack")." | |
fail=1 | |
fi | |
done | |
if [[ $fail=1 ]]; then | |
exit 1 | |
fi | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
deploy: | |
if: github.ref == 'refs/heads/main' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |