-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (64 loc) · 2.28 KB
/
deploy.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
64
65
66
name: Build and Deploy
on:
push:
branches:
- main
pull_request:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
PR_NUM: ${{ github.event.pull_request.number }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Use Node.js 🚧
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies 🚧
run: npm ci
- name: Run Tests and Build 🦺
run: npm pack
- name: Comment on PR 💬
if: github.ref != 'refs/heads/main'
uses: hasura/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
number: ${{ github.event.number }}
id: deploy-preview
message: "Initializing deploy of documentation site preview... ⏳"
- name: Set BASE_URL for Preview Build 🔨
if: github.ref != 'refs/heads/main'
run: echo BASE_URL="https://uniqueck.github.io/asciidoctor-liquibase/pull/${{ env.PR_NUM }}" >> $GITHUB_ENV
- name: Create a .nojekyll file
run: |
touch test/antora/public/.nojekyll
- name: Deploy (main branch) 🚀
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
clean-exclude: pull
branch: gh-pages
folder: test/antora/public
token: ${{secrets.GITHUB_TOKEN}}
- name: Deploy (PR Preview) 🔎
if: github.ref != 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: test/antora/public
target-folder: pull/${{ env.PR_NUM }}
token: ${{ secrets.GITHUB_TOKEN }}
clean: false
- name: Update PR comment 💬
if: github.ref != 'refs/heads/main'
uses: hasura/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
number: ${{ github.event.number }}
id: deploy-preview
message: "🚀 Deploy of docs site preview has been started. It will take a minute or two for changes to appear on the site. See changes here: ${{ env.BASE_URL }}"