first test action
This commit is contained in:
38
.github/workflows/neocities.yml
vendored
38
.github/workflows/neocities.yml
vendored
@@ -19,13 +19,43 @@ concurrency:
|
|||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
prep_array:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.matrix.outputs.value }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: generate posts.html
|
||||||
- name: test
|
run: |
|
||||||
|
echo "<ul class=posts>" > public/posts.html
|
||||||
|
- id: matrix
|
||||||
run: ./compile.sh
|
run: ./compile.sh
|
||||||
|
- run: |
|
||||||
|
echo "${{ steps.matrix.outputs.value }}"
|
||||||
|
build:
|
||||||
|
needs: [ prep_array ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
value: ${{fromJSON(needs.setup.outputs.matrix)}}
|
||||||
|
steps:
|
||||||
|
- 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:
|
||||||
|
- name: finish posts.html
|
||||||
|
run: |
|
||||||
|
echo "</ul>" >> public/posts.html
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Deploy to neocities
|
- name: Deploy to neocities
|
||||||
uses: bcomnes/deploy-to-neocities@v1
|
uses: bcomnes/deploy-to-neocities@v1
|
||||||
|
10
compile.sh
10
compile.sh
@@ -1,7 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
t='['
|
||||||
for entry in notes/*
|
for entry in notes/*
|
||||||
do
|
do
|
||||||
echo $entry
|
echo $entry
|
||||||
test=`git log --follow --format=%ad --date=format:'%Y-%m-%d' -- $entry`
|
filename=$(basename "$entry" .md)
|
||||||
echo $test
|
#filename="${entry%}"
|
||||||
|
timestamp=`git log --follow --format=%ad --date=format:'%Y-%m-%d' -- $entry`
|
||||||
|
t+="{\"source\"=\"$entry\",\"dest\"=\"$filename\",\"time\"=\"$timestamp\"},"
|
||||||
done
|
done
|
||||||
|
echo "value=${t%?}]"
|
||||||
|
echo "value=${t%?}]" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user