-
Notifications
You must be signed in to change notification settings - Fork 7
71 lines (63 loc) · 2.27 KB
/
ci.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
67
68
69
70
71
name: Build docs
on:
push:
branches:
- master
- release/*
pull_request:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
concurrency:
group: ci-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/gh-pages'
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Build docs
run: make build
- name: Deploy preview to Netlify
uses: nwtgck/actions-netlify@v2
if: github.event_name == 'pull_request'
with:
publish-dir: ./site
production-deploy: false
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: ${{ github.event.pull_request.title }}
enable-commit-comment: ${{ github.event_name != 'schedule' }}
alias: preview-${{ github.event.number }}
fails-without-credentials: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 5
- name: Deploy versioned docs
# TODO support publishing non-dev versions
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
PUSH_TOKEN: ${{ secrets.GH_DEPLOY_PUSH_TOKEN }}
run: |
make deploy RELEASE=dev ALIAS=master
git push https://[email protected]/${{ github.repository }} gh-pages
- name: Push gh-pages branch
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/release/'))
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GH_DEPLOY_PUSH_TOKEN }}
branch: gh-pages
- name: Setup tmate session for debug
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 45
with:
limit-access-to-actor: true