From ed0e24792ad6000970d10eea4afe106259cf102c Mon Sep 17 00:00:00 2001 From: Candice Joe Deez IV <105545224+Legendary-Candice-Joe@users.noreply.github.com> Date: Sat, 9 Mar 2024 13:45:49 +1000 Subject: [PATCH] Fix --- .github/workflows/build.yml | 45 ++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd3bf51..5f6cf17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,18 @@ -on: push -name: Build and deploy GH Pages +name: Assorion Website Deploy + +env: + ZOLA_VERSION: "0.15.3" + SOURCE_BRANCH: "main" + TARGET_BRANCH: "gh-pages" + +on: + push: + branches: + - main + pull_request: + branches: + - main + jobs: build: runs-on: ubuntu-latest @@ -7,15 +20,21 @@ jobs: pull-requests: write contents: write issues: write - if: github.ref == 'refs/heads/main' steps: - - name: checkout - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 'latest' - - name: build_and_deploy - uses: shalzz/zola-deploy-action@v0.18.0 - env: - PAGES_BRANCH: gh-pages - TOKEN: ${{ secrets.GITHUB_TOKEN}} + - name: Check out repo + uses: actions/checkout@main + - 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: Generate HTML + run: zola build + - name: Deploy to gh-pages + if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', env.SOURCE_BRANCH) }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./gh-pages + force_orphan: true