forked from camptocamp/devops-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (78 loc) ยท 2.36 KB
/
Copy pathwebsite.yml
File metadata and controls
79 lines (78 loc) ยท 2.36 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Website
on:
push:
branches:
- master
env:
SITE_DIR: 'site'
jobs:
build_site:
name: "Build main site with Hugo"
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes
fetch-depth: 0 # Fetch all history for .gitinfo and .lastmod
- name: "Setup Hugo"
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.79.1'
extended: true
- name: "Build"
run: hugo --minify -s site
- name: "Upload generated site"
uses: actions/upload-artifact@v1.0.0
with:
name: hugo
path: "${{ github.workspace }}/site/public"
build_antora:
name: "Build docs site with Antora"
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for .gitinfo and .lastmod
- name: "Generate site using antora site action"
uses: kameshsampath/antora-site-action@master
with:
antora_playbook: antora-playbook.yml
- name: "List folder"
run: |
ls -ltr $GITHUB_WORKSPACE/build/
- name: "Upload generated site"
uses: actions/upload-artifact@v1.0.0
with:
name: antora
path: "${{ github.workspace }}/build/${{ env.SITE_DIR }}"
deploy_site:
runs-on: [ubuntu-latest]
needs: [build_site, build_antora]
name: "Deploy GitHub Pages"
steps:
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1.4.4
with:
node-version: 12.x
- name: Checkout
uses: actions/checkout@v2
- name: Download generated Hugo site
uses: actions/download-artifact@v1
with:
name: hugo
path: "${{ github.workspace }}/${{ env.SITE_DIR }}"
- name: Download generated Antora docs
uses: actions/download-artifact@v1
with:
name: antora
path: "${{ github.workspace }}/${{ env.SITE_DIR }}/docs"
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@3.2.1
with:
# ACCESS_TOKEN: # optional
GITHUB_TOKEN: "${{ github.token}}"
FOLDER: "${{ env.SITE_DIR }}"
BRANCH: 'gh-pages'
COMMIT_MESSAGE: "[CI] Publish Documentation for ${{ github.sha }}"