-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (58 loc) · 1.8 KB
/
gnatdoc.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
on:
push:
branches:
- master
- topic/gnatdoc
name: Make Docs
jobs:
build:
runs-on: ubuntu-latest
name: Docs
steps:
- name: Get VSS
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: ./cached_gnat
key: ${{ runner.os }}-alire_v1
restore-keys: ${{ runner.os }}-alire_v1
- name: Get GNAT toolchain with alire
uses: alire-project/setup-alire@v2
with:
toolchain: gnat_native^11 gprbuild^21
toolchain_dir: ./cached_gnat
- name: Install gnatdoc
env:
AWS_ACCESS_KEY_ID: ${{secrets.GHA_CACHE_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.GHA_CACHE_SECRET}}
AWS_DEFAULT_REGION: eu-west-1
run: |
aws s3 cp s3://adacore-gha-tray-eu-west-1/gnatdoc/gnatdoc-Linux.tar.gz .
tar xzvf gnatdoc-Linux.tar.gz
- name: install pandoc
run: sudo apt-get install -y pandoc
- name: Build project and docs
run: |
export PATH=$PWD/bin:`ls -d $PWD/cached_gnat/*/bin |tr '\n' ':'`$PATH
make docs
- name: Upload to gh-pages branch
run: |
# Set up .netrc file with GitHub credentials
cat << EOF > $HOME/.netrc
machine github.com
login sync_bot
password $GITHUB_ACCESS_TOKEN
EOF
chmod 600 $HOME/.netrc
git config user.email `git log -1 --pretty=format:'%ae'`
git config user.name `git log -1 --pretty=format:'%an'`
git checkout gh-pages
git reset --hard HEAD^
cp -fr .docs/* .
git add index.html html
if git commit -m "" --allow-empty-message; then
git push -f
fi
git status