update for day 9 #149
This file contains hidden or 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/deploy website | |
| env: | |
| ZOLA_VERSION: "0.19.2" | |
| # CNAME: "example.org" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository and submodules | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install zola | |
| run: | | |
| set -x | |
| wget -O - \ | |
| "https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" \ | |
| | sudo tar xzf - -C /usr/local/bin | |
| - name: Build the website | |
| run: zola build | |
| - name: Add CNAME | |
| if: github.ref == 'refs/heads/main' | |
| run: echo -n ${{ env.CNAME }} > public/CNAME | |
| - name: Deploy to gh-pages | |
| if: github.ref == 'refs/heads/main' | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./public | |
| force_orphan: true |