diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 0000000..24a35d9 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,43 @@ +# .github/workflows/preview.yml +name: Deploy PR previews + +env: + ZOLA_VERSION: "0.17.2" + # MAIN_BRANCH: "main" + # TARGET_BRANCH: "gh-pages" + # CNAME: "hpc.uit.no" +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed + +concurrency: preview-${{ github.ref }} + +jobs: + deploy-preview: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - 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: Generate HTML + run: zola build + # Add CNAME, either (first one used) + # - file in the root + # - the environment variable set above + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./public \ No newline at end of file