generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (51 loc) · 1.78 KB
/
publish.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
name: Publish
on:
push:
branches:
- main
schedule:
# Schedule: 5:30PM Monday-Friday UTC, which is roughly
# 10:30 AM Pacific (give or take some DST) on weekdays.
- cron: '30 17 * * MON-FRI'
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-24.04 # don't use "-latest", we can manually update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GNUPGHOME: /tmp # avoid "gpg: Fatal: can't create directory '/home/runner/.gnupg': File exists"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gzip bzip2 xz-utils zstd tar rpm cpio dpkg make
pip install pipenv
mkdir -p .venv && pipenv install
- name: Checkout gh-pages and setup git
run: |
git fetch origin gh-pages --depth=1
git worktree add ../gh-pages gh-pages
git config --global user.name 'Github Actions'
git config --global user.email '[email protected]'
- name: Fetch updates and build page
run: |
.venv/bin/python -m kconfigs.main config.ini \
--state ../gh-pages/state.json \
--output-dir ../gh-pages/out
.venv/bin/python -m kconfigs.cleanup config.ini \
--input-dir ../gh-pages/out
.venv/bin/python -m kconfigs.analyzer config.ini \
--input-dir ../gh-pages/out \
--output-file ../gh-pages/docs/summary.json
cp index.html tux-sm.png ../gh-pages/docs/
- name: Push update
run: |
cd ../gh-pages
git add .
git commit -m "Automatic update"
git push origin gh-pages