diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cc4202a6..cab0ef94 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,54 +8,48 @@ jobs: runs-on: ubuntu-latest steps: - - name: Download Branch - uses: actions/checkout@v2 - - - name: Update Submodule - run: | - git submodule init - git submodule update --remote - - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: "14.x" - - - name: Install NodeModules - run: | - rm -f .yarnclean yarn.lock - yarn --non-interactive --silent - yarn list --depth=0 - - - name: Install Pandoc - run: sudo apt-get install -y pandoc - - - name: Hexo Generate - run: | - rm -rf ./public - yarn run hexo clean - yarn run hexo generate - - - name: Turnstyle - uses: softprops/turnstyle@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup qshell - uses: foxundermoon/setup-qshell@v5 - with: - version: '2.12.0' - - - name: Upload to OSS - env: - QINIU_ACCESSKEY: ${{ secrets.QINIU_ACCESSKEY }} - QINIU_SECRETKEY: ${{ secrets.QINIU_SECRETKEY }} - QINIU_BUCKET: 'fluid-dev' - run: | - qshell account $QINIU_ACCESSKEY $QINIU_SECRETKEY action - qshell listbucket $QINIU_BUCKET -o bucket.txt - awk -F '\t' '!/docs\// && !/Key/ {print $1}' bucket.txt > to_delete.txt - qshell batchdelete -F'\t' --force $QINIU_BUCKET -i to_delete.txt - qshell qupload2 --src-dir=./public --bucket=$QINIU_BUCKET --overwrite - echo 'https://hexo.fluid-dev.com/' >> cdnrefresh.txt - qshell cdnrefresh --dirs -i cdnrefresh.txt + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + # If your repository depends on submodule, please see: https://github.com/actions/checkout + submodules: recursive + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Cache NPM dependencies + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.OS }}-npm-cache + restore-keys: | + ${{ runner.OS }}-npm-cache + + - name: Install Pandoc + run: sudo apt-get install -y pandoc + + - name: Install Dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./public + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 \ No newline at end of file