docs: correct response and json (#138) #42
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: Build and deploy to Pages | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '_data/**' | |
- 'docs/**' | |
- 'pages/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
bundler-cache: true | |
cache-version: 0 | |
- name: Build with Jekyll | |
run: JEKYLL_ENV=production bundle exec jekyll build | |
- name: Upload pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
deploy: | |
needs: build | |
if: ${{ github.ref == 'refs/heads/master' }} | |
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@v4 | |
oss: | |
needs: deploy | |
runs-on: ubuntu-latest | |
env: | |
UPLOAD_DIR: ghp-for-oss | |
steps: | |
- name: Download artifacts from build | |
uses: actions/download-artifact@v4 | |
with: | |
name: github-pages | |
- name: Unpack artifacts | |
run: mkdir ${{ env.UPLOAD_DIR }} && tar -xvf artifact.tar -C ${{ env.UPLOAD_DIR }} | |
- name: Setup ossutil | |
run: | | |
curl https://gosspublic.alicdn.com/ossutil/install.sh | sudo bash | |
ossutil64 config -e ${{ secrets.OSS_ENDPOINT }} -i ${{ secrets.OSS_AK_ID }} -k ${{ secrets.OSS_AK_SECRET }} | |
- name: Upload to oss | |
run: ossutil64 sync -uf ${{ env.UPLOAD_DIR }} oss://${{ secrets.OSS_BUCKET }} --delete --disable-dir-object |