-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.41 KB
/
update.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
name: update
permissions:
contents: read
on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
run-id:
description: 'GHA docs workflow run ID'
required: true
type: string
push:
description: 'Push'
required: true
default: false
type: boolean
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download documentation artifact
run: |
gh run download \
--repo mpi4py/mpi4py \
--name mpi4py-docs \
${{ inputs.run-id }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Update documentation contents
run: |
# unarchive
docdir=mpi4py-docs
unzip -q $docdir.zip
mv $docdir/version .
version=$(cat version)
test ! -d $version
mv $docdir $version
rm -f stable
ln -sf $version stable
- name: Commit changes
run: |
# git add + commit
git config user.name "$(git log -1 --pretty=format:%an)"
git config user.email "$(git log -1 --pretty=format:%ae)"
version=$(cat version)
git add $version stable
git commit -m $version
- name: Show changes
run: git show --stat
- name: Push changes
if: ${{ inputs.push }}
run: git push