Merge branch 'writing' #199
Workflow file for this run
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 github page using vitepress | |
on: | |
push: | |
branches: | |
- main | |
env: | |
DOMAIN: blog.usword.cn | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
REPOSITORY: ${{ github.repository }} | |
OWNER: ${{ github.repository_owner }} | |
EMAIL: "[email protected]" | |
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
ALGOLIA_APP_KEY: ${{ secrets.ALGOLIA_APP_KEY }} | |
ALGOLIA_APP_INDEXNAME: ${{ secrets.ALGOLIA_APP_INDEXNAME }} | |
GITALK_ID: ${{ secrets.GITALK_ID }} | |
GITALK_SECRET: ${{ secrets.GITALK_SECRET }} | |
jobs: | |
build-and-deploy: | |
name: deploy github page | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: install pnpm | |
run: yarn global add pnpm | |
- name: set env variables | |
run: echo ALGOLIA_APP_ID=${{ env.ALGOLIA_APP_ID }} >> .env && echo ALGOLIA_APP_KEY=${{ env.ALGOLIA_APP_KEY }} >> .env && echo ALGOLIA_APP_INDEXNAME=${{ env.ALGOLIA_APP_INDEXNAME }} >> .env && echo GITALK_ID=${{ env.GITALK_ID }} >> .env && echo GITALK_SECRET=${{ env.GITALK_SECRET }} >> .env | |
- name: build project | |
run: pnpm install --no-frozen-lockfile && pnpm build | |
- run: ls | |
- name: generate sitemap | |
run: chmod +x ./scripts/generate-sitemap.sh && ./scripts/generate-sitemap.sh | |
- name: deploy page | |
run: chmod +x ./scripts/deploy-page.sh && ./scripts/deploy-page.sh | |
# use other action | |
# - name: deploy github page | |
# uses: JamesIves/[email protected] | |
# with: | |
# branch: gh-pages | |
# folder: ${{ env.BUNDLE_DIST }} |