-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (105 loc) · 3.32 KB
/
pull-request-done.yml
File metadata and controls
120 lines (105 loc) · 3.32 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI/CD Pull Requests Close
on:
pull_request:
types: [closed]
jobs:
# Inspect the information that is accessible in each context
# https://docs.github.com/en/actions/learn-github-actions/contexts#example-printing-context-information-to-the-log-file
# You can delete this section
jobinfo:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJSON(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJSON(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJSON(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump strategy context
env:
STRATEGY_CONTEXT: ${{ toJSON(strategy) }}
run: echo "$STRATEGY_CONTEXT"
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJSON(matrix) }}
run: echo "$MATRIX_CONTEXT"
preview_delete:
runs-on: ubuntu-latest
name: "Delete preview"
steps:
- name: Hello
run: |
echo "Hello World!"
create_release:
runs-on: "ubuntu-latest"
if: github.event.pull_request.merged == true && startsWith( github.head_ref, 'release/')
name: "Create Release"
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Get the version
id: get_version
run: |
ref=$(echo "${{ github.head_ref }}")
echo ::set-output name=VERSION::${ref/release\//}
- name: Create Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ github.token }}"
automatic_release_tag: "v${{ steps.get_version.outputs.VERSION }}"
prerelease: false
title: "Release v${{ steps.get_version.outputs.VERSION }}"
# files: |
generate_docs:
runs-on: ubuntu-latest
needs: [ create_release ]
name: "Generate documentation"
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
- name: Cache pip
uses: actions/cache@v3.0.11
with:
path: ~/.cache/pip
key: docs-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements**.txt') }}
- name: Install requirements
run: |
pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt -e .
- name: Generate docs
run: |
cd docs
make html
- name: Push to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ github.token }}
publish_dir: ./docs/_build/html
allow_empty_commit: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: "Generated documentation @ ${{ github.sha }}"
prod_deploy:
needs: [ create_release ]
runs-on: ubuntu-latest
name: "Deploy production"
steps:
- name: Hello
run: |
echo "Hello World!"