-
Notifications
You must be signed in to change notification settings - Fork 18
47 lines (39 loc) · 1.22 KB
/
docs.yaml
File metadata and controls
47 lines (39 loc) · 1.22 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
name: "📚 Publish Docs"
permissions:
contents: write
on:
# Workflow dispatch is used for manual triggers
workflow_dispatch:
# Workflow call is used for called from another workflow
workflow_call:
env:
GITHUB_PAGES_BRANCH: gh-pages
jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 20
cache: yarn
cache-dependency-path: documentation/yarn.lock
- name: Install dependencies and build website
run: |
cd documentation
yarn install --frozen-lockfile
yarn build
- name: Push static files to Github Pages branch
run: |
cd documentation/build
CREATED_FROM_REF=$(git rev-parse --short HEAD)
git init
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git checkout -b $GITHUB_PAGES_BRANCH
git remote add $GITHUB_PAGES_BRANCH https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/equinor/tagreader-python
git add .
git commit -m "Built from commit '$CREATED_FROM_REF'"
git push -f --set-upstream gh-pages gh-pages