12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- name: "Deploy to GitHub Pages"
- on:
- workflow_dispatch:
- push:
- branches:
- - develop
- jobs:
- build:
- name: Build
- runs-on: ubuntu-latest
- steps:
- - name: Set up Node.js
- uses: actions/setup-node@v4
- env:
- NODE_AUTH_TOKEN: ${{ github.token }}
- with:
- node-version: 20.x
- - name: Checkout repository
- uses: actions/checkout@v4
- - name: Set auth token
- run: echo '//npm.pkg.github.com/:_authToken=${{ secrets.GH_PAT }}' >> .npmrc
- - name: Install dependencies
- run: npm ci
- - name: Build statics
- run: npm run build
- env:
- VITE_ANALYTICS_WEBSITE_ID: ${{ vars.ANALYTICS_WEBSITE_ID }}
- - name: Upload artifact
- uses: actions/upload-pages-artifact@v3
- with:
- name: github-pages
- path: dist/
- retention-days: 3
- # https://github.com/actions/deploy-pages?tab=readme-ov-file#usage
- deploy:
- name: Deploy
- needs: build
- permissions:
- pages: write
- id-token: write
- runs-on: ubuntu-latest
- steps:
- - name: Deploy to GitHub Pages
- id: deployment
- uses: actions/deploy-pages@v4
- # # https://github.com/annybs/notify-discord
- # notify:
- # name: Notify Discord
- # uses: annybs/notify-discord@develop
- # needs: deploy
- # if: ${{ always() }}
- # with:
- # discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}
- # repository: ${{ github.repository }}
- # result: ${{ needs.deploy.result }}
- # run_id: ${{ github.run_id }}
- # run_number: ${{ github.run_number }}
- # workflow: ${{ github.workflow }}
|