This repository was archived by the owner on Mar 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
55 lines (55 loc) · 1.78 KB
/
development.yaml
File metadata and controls
55 lines (55 loc) · 1.78 KB
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
name: Development
on:
pull_request:
push:
branches:
- main
jobs:
build-docs:
runs-on: ubuntu-latest
env:
DOCKER_CLIENT_TIMEOUT: "120"
COMPOSE_HTTP_TIMEOUT: "120"
steps:
- uses: actions/checkout@v2
- name: Compile docs static artifacts
run: |
docker-compose -f docker-compose-mkdocs-build.yaml up --exit-code-from app --build
- name: Add docs static artifacts
uses: actions/upload-artifact@v2
with:
name: docs-static-datajoint-elements
path: site
retention-days: 1
publish-docs:
if: github.event_name == 'push'
needs: build-docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch docs static artifacts
uses: actions/download-artifact@v2
with:
name: docs-static-datajoint-elements
path: gh-pages/site
- name: Commit documentation changes
run: |
git clone https://github.com/${GITHUB_REPOSITORY}.git \
--branch gh-pages --single-branch gh-pages-branch
rm -R gh-pages-branch/*
cp -r gh-pages/site/* gh-pages-branch/
touch gh-pages-branch/.nojekyll
echo "elements.datajoint.org" > gh-pages-branch/CNAME
cd gh-pages-branch
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add . --all
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# the return code.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages-branch
github_token: ${{secrets.GITHUB_TOKEN}}