Skip to content

Commit 454f019

Browse files
Merge pull request #537 from MetRonnie/actions
Fix `undeploy` workflow's `versions.json` cleanup
2 parents d59680f + f896c7d commit 454f019

File tree

3 files changed

+32
-25
lines changed

3 files changed

+32
-25
lines changed

.github/workflows/deploy.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,21 @@ jobs:
6565
with:
6666
python-version: '3.9'
6767

68+
- name: configure git
69+
uses: cylc/release-actions/configure-git@v1
70+
6871
- name: checkout cylc-doc
6972
uses: actions/checkout@v3
7073
with:
71-
ref: ${{ github.event.inputs.cylc-flow-tag }}
74+
ref: ${{ inputs.cylc-flow-tag }}
7275
path: docs
7376

7477
- name: install dependencies
7578
uses: cylc/cylc-doc/.github/actions/install-dependencies@master
7679

7780
- name: install cylc-doc
78-
run: pip install "${{ github.workspace }}/docs[all]"
81+
working-directory: docs
82+
run: pip install ".[all]"
7983

8084
- name: install libs to document
8185
uses: cylc/cylc-doc/.github/actions/install-libs@master
@@ -94,21 +98,18 @@ jobs:
9498
path: gh-pages
9599

96100
- name: sync static files
97-
if: ${{ github.event.inputs.set_stable == 'true' }}
101+
if: ${{ inputs.set_stable }}
102+
env:
103+
DOCS: '${{ github.workspace }}/docs'
104+
PAGE: '${{ github.workspace }}/gh-pages'
98105
run: |
99-
DOCS="${{ github.workspace }}/docs" \
100-
PAGE="${{ github.workspace }}/gh-pages" \
101-
102106
rsync -r "$DOCS/doc/" "$PAGE/"
103107
104108
- name: install gh-pages
109+
working-directory: docs
105110
run: |
106-
DOCS="${{ github.workspace }}/docs" \
107-
PAGE="${{ github.workspace }}/gh-pages" \
108-
109-
cd "$DOCS"
110111
rm -r doc
111-
ln -s "$PAGE" doc
112+
ln -s ../gh-pages doc
112113
113114
- name: build docs
114115
run: |
@@ -120,20 +121,17 @@ jobs:
120121
slides \
121122
linkcheck \
122123
SPHINXOPTS='-Wn' \
123-
STABLE=${{ github.event.inputs.set_stable }} \
124-
LATEST=${{ github.event.inputs.set_latest }}
125-
126-
- name: configure git
127-
uses: cylc/release-actions/configure-git@v1
124+
STABLE=${{ inputs.set_stable }} \
125+
LATEST=${{ inputs.set_latest }}
128126
129127
- name: tidy old versions
128+
working-directory: docs
130129
run: |
131-
cd docs
132-
git rm -r $("${{ github.workspace }}/docs/bin/version" tidy) || true
130+
git rm -r $("./bin/version" tidy) || true
133131
134132
- name: push changes
133+
working-directory: gh-pages
135134
run: |
136-
cd gh-pages
137135
git add *
138-
git commit -m "add: ${{ github.event.inputs.cylc-flow-tag }}"
136+
git commit -m "add: ${{ inputs.cylc-flow-tag }}"
139137
git push origin HEAD

.github/workflows/shortlog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- '.github/workflows/shortlog.yml'
1010

1111
jobs:
12-
test:
12+
shortlog:
1313
runs-on: 'ubuntu-latest'
1414
timeout-minutes: 10
1515
steps:

.github/workflows/undeploy.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,20 @@ jobs:
3636
runs-on: ubuntu-18.04
3737
timeout-minutes: 10
3838
env:
39-
TAG: ${{ github.event.inputs.tag }}
39+
TAG: ${{ inputs.tag }}
4040
steps:
4141
- name: configure python
4242
uses: actions/setup-python@v4
4343
with:
4444
python-version: '3.9'
4545

46+
- name: configure git
47+
uses: cylc/release-actions/configure-git@v1
48+
4649
- name: checkout cylc-doc
4750
uses: actions/checkout@v3
51+
with:
52+
path: docs
4853

4954
- name: checkout gh-pages
5055
uses: actions/checkout@v3
@@ -67,17 +72,21 @@ jobs:
6772
fi
6873
done
6974
70-
- name: configure git
71-
uses: cylc/release-actions/configure-git@v1
75+
- name: install gh-pages
76+
working-directory: docs
77+
run: |
78+
rm -r doc
79+
ln -s ../gh-pages doc
7280
7381
- name: remove version
7482
working-directory: gh-pages
7583
run: |
7684
git rm -r "$TAG"
7785
7886
- name: update version file
87+
working-directory: docs
7988
run: |
80-
bin/version write
89+
bin/version write > doc/versions.json
8190
8291
- name: push changes
8392
working-directory: gh-pages

0 commit comments

Comments
 (0)