-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (42 loc) · 1.22 KB
/
build-website.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build website
on: [push, workflow_dispatch]
env:
OUTPUT_DIR: pandoc-output
jobs:
build:
runs-on: ubuntu-20.04
container:
image: docker://pandoc/core:2.14
options: --entrypoint=sh
steps:
- name: Install dependencies
run: apk add make git
- name: Checkout repository content
uses: actions/checkout@v2
- name: Convert via pandoc
run: make
- name: Copy custom domain name configuration
run: |
(test -f CNAME && cp CNAME ${{ env.OUTPUT_DIR }}) || echo "CNAME not there yet"
- name: Store generated content
uses: actions/upload-artifact@v2
with:
path: ${{ env.OUTPUT_DIR }}
name: website
deploy:
needs: build
if: success() && github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
steps:
- name: Load generated content
uses: actions/download-artifact@v2
with:
name: website
path: ${{ env.OUTPUT_DIR }}
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: ${{ env.OUTPUT_DIR }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}