Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First attempt to build on pull requests #51

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -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
Loading