Update Bash.md #18
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 to Github Pages | |
on: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Run image | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: "1.4.2" | |
- name: Setup a local virtual environment | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v4 | |
name: Cache Python deps | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install Python dependencies | |
run: poetry install | |
- name: Build files from sources | |
run: | | |
poetry run python main.py \ | |
--ignored-dirs '.obsidian,.git' \ | |
--verbose \ | |
--source-dir sources \ | |
--base-dir . \ | |
--template-dir templates \ | |
build | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install Node dependencies | |
run: npm ci | |
- uses: actions/cache@v4 | |
name: Cache Node deps | |
with: | |
path: ./node_modules | |
key: venv-${{ hashFiles('package-lock.json') }} | |
- name: Prepare workspace | |
run: | | |
mv build wiki | |
mv wiki/links.json .vitepress/links.json | |
- name: Build static files | |
run: npm run docs:build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: .vitepress/dist | |
deploy: | |
environment: | |
name: github-pages | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |