New site preview CI job

This commit is contained in:
Jonas Platte 2022-10-06 10:46:32 +02:00
parent 1c3fbfc6eb
commit 7b804d0947
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67
3 changed files with 37 additions and 21 deletions

View file

@ -10,3 +10,7 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
# GitHub workflows
[*.yml]
indent_size = 2

33
.github/workflows/zola.yml vendored Normal file
View file

@ -0,0 +1,33 @@
name: Build site
on:
push:
branches:
- zola
jobs:
deploy:
name: Build and deploy the site
runs-on: ubuntu-latest
steps:
- name: Repository checkout
uses: actions/checkout@v2
- name: Download Zola
run: |
version='v0.16.1'
archive="zola-${version}-x86_64-unknown-linux-gnu.tar.gz"
curl -L "https://github.com/getzola/zola/releases/download/${version}/${archive}" -o "$archive"
tar xf "$archive"
- name: Build
run: |
./zola build
- name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
folder: public
repository-name: matrix-org/zola-preview
branch: main
ssh-key: ${{ secrets.ZOLA_DEPLOY_KEY }}

View file

@ -1,21 +0,0 @@
# This is just added to share it while I'm working on it
on: push
name: Build and deploy GH Pages
jobs:
build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/MTRNord/zola'
steps:
- name: checkout
uses: actions/checkout@v2
- name: Set twitter secret
run: sed -i "s/%twitter_secret%/$TWITTER_TOKEN/" zola/config.toml
env:
TWITTER_TOKEN: ${{ secrets.TWITTER_TOKEN }}
- name: build_and_deploy
uses: shalzz/zola-deploy-action@v0.16.1
env:
PAGES_BRANCH: gh-pages
BUILD_DIR: zola
TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHECK_LINKS: true