67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: Deploy to neocities
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
env:
|
|
FORCE_COLOR: 1
|
|
node_version: lts/*
|
|
|
|
concurrency:
|
|
group: deploy-to-neocities
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.matrix.outputs.value }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: |
|
|
cd ${{ github.workspace }}
|
|
echo "<ul class=posts>" > public/posts.html
|
|
./compile.sh >> "$GITHUB_OUTPUT"
|
|
- run: |
|
|
echo "${{ steps.matrix.outputs.value }}"
|
|
build:
|
|
needs: [ setup ]
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
value: ${{fromJSON(needs.setup.outputs.matrix)}}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: markdown to html
|
|
uses: jaywcjlove/markdown-to-html-cli@main
|
|
with:
|
|
source: ${{ matrix.value.source }}
|
|
output: public/posts/${{ matrix.value.time }}_${{ matrix.value.dest }}.html
|
|
github-corners: https://github.com/jaywcjlove/markdown-to-html-cliA
|
|
- name: generate posts.html entries
|
|
run:
|
|
echo "<li class=\"post\"><a href=\"${{ matrix.value.time }}_${{ matrix.value.dest }}\">${{ matrix.value.dest }}</a></li>" >> public/posts.html
|
|
|
|
deploy:
|
|
needs: [ build ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: finish posts.html
|
|
run: |
|
|
echo "</ul>" >> ${{ github.workspace }}public/posts.html
|
|
|
|
- name: Deploy to neocities
|
|
uses: bcomnes/deploy-to-neocities@v1
|
|
with:
|
|
api_token: ${{ secrets.NEOCITIES_API_TOKEN }}
|
|
cleanup: true
|
|
dist_dir: public
|
|
protected_files: 'dropbox/*'
|