-
Notifications
You must be signed in to change notification settings - Fork 11
39 lines (37 loc) · 1.17 KB
/
create-landing-page.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
name: create-landing-page
on:
push:
branches:
- master
paths:
- 'CITATION.cff'
release:
types: [published]
jobs:
update-landing-page:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: gh-pages
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Update pip and install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install cffconvert==2.0.0
python -m pip install pyyaml==6.0
- name: Set env var based on (master) push trigger
if: github.event_name == 'push'
run: echo "PAGE_TYPE=latest" >> $GITHUB_ENV
- name: Set env var based on release
if: github.event_name == 'release'
run: echo "PAGE_TYPE=${{ github.event.release.name }}" >> $GITHUB_ENV
- name: Create landing page
run: python write_doi_landing_page.py ${{ env.PAGE_TYPE }}
- uses: EndBug/add-and-commit@v9
with:
add: '["index.markdown", "versions/*.markdown"]'
default_author: github_actions
message: 'Update ${{ env.PAGE_TYPE }} landing page'