Improve post text #60
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
name: Deployment | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
# Allow only one concurrent deployment. | |
concurrency: | |
group: pages | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build website | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build website | |
run: | | |
npm run build | |
echo "${{github.sha}} (${{github.ref_name}})" > ./dist/commit.txt | |
# Make SPA website work with GitHub Pages. | |
for id in $(grep 'id: "[0-9]*"' ./src/posts.ts | grep -o '[0-9]*'); do | |
cp ./dist/index.html ./dist/$id.html | |
done | |
- name: Upload website | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist | |
deploy-to-github-pages: | |
needs: build | |
name: Deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
environment: | |
name: Production | |
url: ${{steps.deployment.outputs.page_url}} | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Deploy website to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |