generated from HarshKapadia2/asciidoctor-jet
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.71 KB
/
build-deploy-website.yaml
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
name: Build and deploy website
on:
push:
branches:
- main
paths:
- ".github/workflows/**"
- "src/**"
- build.sh
pull_request:
branches:
- main
paths:
- ".github/workflows/**"
- "src/**"
- build.sh
workflow_dispatch: # Allows manual execution of workflow
jobs:
build-website:
if: startsWith(github.ref, 'refs/pull/')
runs-on: ubuntu-latest
container: "docker://asciidoctor/docker-asciidoctor:latest"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build site using Asciidoctor
run: |
# Give execution permission to buildscript
chmod +x build.sh
# Run buildscript
./build.sh
build-deploy-website:
if: startsWith(github.ref, 'refs/heads/')
runs-on: ubuntu-latest
container: "docker://asciidoctor/docker-asciidoctor:latest"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build site using Asciidoctor
run: |
# Give execution permission to buildscript
chmod +x build.sh
# Run buildscript
./build.sh
- name: Install package for Deploy Action
run: |
apk update
apk add rsync
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.8
with:
branch: gh-pages
folder: build
clean: true