-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (50 loc) · 1.9 KB
/
Copy pathmain.yml
File metadata and controls
57 lines (50 loc) · 1.9 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
48
49
50
51
52
53
54
55
56
57
name: GitHub Pages
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: "[cdd-python] Generate documentation"
run: |
git clone --depth=1 --single-branch https://github.com/offscale/cdd-python
pushd cdd-python
python3 -m pip install -U pip
python3 -m pip install -U setuptools wheel
python3 -m pip install -r requirements-docs.txt
mkdocs build
popd
- name: Prepare and deploy
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
DIST: 'dist/offscale-www'
TARGET: 'offscale/offscale.github.io'
CNAME: 'offscale.io'
run: |
npm i -g npm
npm i -g @angular/cli typescript angular-cli-ghpages
ng add --skip-confirmation angular-cli-ghpages
npm ci
MSG="$(git show -s --format='%s' "$GITHUB_SHA")"
email_author="$(git log -1 --pretty=format:'%an <%ce>')"
author="${email_author% *}"
git config --global user.name "$author"
email="${email_author#*<}"; email="${email::-1}"
git config --global user.email "$email"
ng build --configuration production --base-href 'https://'"$CNAME"
head -n6 README.md > "$DIST"'/README.md'
mv "$DIST"'/browser'/* "$DIST"
mv cdd-python/site "$DIST"'/cdd-python'
npx angular-cli-ghpages --dir="$DIST" --cname="$CNAME" --repo='https://'"$GITHUB_TOKEN"'@github.com/'"$TARGET" --branch='master' --message="$MSG" --name="$name" --email="$email" --no-silent