-
Notifications
You must be signed in to change notification settings - Fork 73
68 lines (58 loc) · 1.65 KB
/
gh-pages.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: GitHub Pages
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
ci_checks:
name: Build checks
uses: ./.github/workflows/ci-checks.yml
build:
name: Build documentation
needs: ci_checks
runs-on: ubuntu-latest
steps:
- name: Checkout (build)
uses: actions/checkout@v4
with:
path: build
- name: Checkout (publish)
uses: actions/checkout@v4
with:
path: publish
- name: Cache build dependencies
uses: actions/cache@v4
env:
cache-name: makefile-deps
with:
path: ~/.cache/fabric-protos
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Makefile') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('Makefile') }}
${{ runner.os }}-${{ env.cache-name }}-
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- name: Run make
run: make genprotos
working-directory: build
- name: Create GitHub pages commit
run: |
git config --global user.email "[email protected]"
git config --global user.name "hyperledger-bot"
git checkout --orphan publish-pages
git rm -rf .
cp -a ../build/docs/. .
git add -A
git commit -m "Deploy to GitHub Pages"
git status
git log --name-status
working-directory: publish
- name: Push GitHub pages commit
run: git push --force origin publish-pages:gh-pages
if: github.event_name != 'pull_request'
working-directory: publish