chore: change formating #15
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: Deploy | |
on: | |
push: | |
paths: | |
- "github/workflows/release.yml" | |
- ".github/runners/generate/**" | |
- "public/posts/**" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Setup Python" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- name: "Install dependencies" | |
run: python -m pip install -r .github/runners/generate/requirements.txt | |
- name: "Create metadata" | |
run: python .github/runners/generate/generate.py | |
- uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
message: "chore: update metadata" | |
build: | |
name: Build and deploy main | |
needs: generate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/[email protected] | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/node_modules | |
key: cache-${{ hashFiles('**/package-lock.json') }} | |
- name: Install and build | |
run: | | |
yarn install | |
yarn build | |
# Enable Vue Router history mode with 404.html hack for Github Pages | |
cd dist | |
ln -s index.html 404.html | |
- name: Deploy to github pages | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: dist | |
- name: Publish deployed code | |
uses: actions/upload-artifact@v3 | |
with: | |
name: published | |
path: dist |