First attempt to build on pull requests #2
Workflow file for this run
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
# .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 |