2020-2024 最喜欢的 10 篇文章和一张图 #78
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 static content to Pages | |
on: | |
issues: | |
types: | |
- opened | |
- edited | |
- closed | |
- reopened | |
- labeled | |
- unlabeled | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ github.token }} | |
ISITE_VERSION: v0.1.3 | |
ZOLA_VERSION: v0.19.2 | |
USER: ${{ github.repository_owner }} | |
REPO: ${{ github.event.repository.name }} | |
BASE_URL: https://blog.yihong0618.me # change to your own domain | |
# Change to below if you are using GitHub Pages | |
# BASE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Generate markdown | |
run: | | |
gh release download $ISITE_VERSION --repo kemingy/isite -p '*Linux_x86_64*' --output isite.tar.gz | |
tar zxf isite.tar.gz && mv isite /usr/local/bin | |
isite generate --user $USER --repo $REPO | |
gh release download $ZOLA_VERSION --repo getzola/zola -p '*linux*' --output zola.tar.gz | |
tar zxf zola.tar.gz && mv zola /usr/local/bin | |
cp config.toml output/config.toml | |
cd output && zola build --base-url $BASE_URL | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: 'output/public' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v3 |