Skip to content

chore: update configuration, workflow and pull request template (#2) #7

chore: update configuration, workflow and pull request template (#2)

chore: update configuration, workflow and pull request template (#2) #7

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: Deploy to GitHub Pages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
pages: write
jobs:
deploy:
if: github.repository == 'li-dao/wiki'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
lfs: true
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Set Environment Variables
run: |
echo "GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}" >> $GITHUB_ENV
echo "GOOGLE_TAG_MANAGER_ID=${{ secrets.GOOGLE_TAG_MANAGER_ID }}" >> $GITHUB_ENV
- name: Build
env:
GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_TAG_ID }}
GOOGLE_TAG_MANAGER_ID: ${{ secrets.GOOGLE_TAG_MANAGER_ID }}
run: bun run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build # default: public