-
Notifications
You must be signed in to change notification settings - Fork 580
52 lines (45 loc) · 1.76 KB
/
preview-env-template.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
name: preview-env-setup-template
on:
workflow_call:
inputs:
PR_NUMBER:
type: string
required: true
TRIGGERING_ACTOR:
type: string
required: true
COMMIT_SHA:
type: string
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
submodules: true
fetch-depth: 0
ref: ${{ inputs.COMMIT_SHA }}
- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: 3.12
- name: ci/Install dependencies
run: make python-deps
- name: Build
run: make SPHINXOPTS="-j auto -D html_baseurl=http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/${{ inputs.PR_NUMBER }}" html
- uses: shallwefootball/s3-upload-action@4350529f410221787ccf424e50133cbc1b52704e # v1.3.3
name: Upload Preview Env
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_bucket: mattermost-docs-preview-pulls
source_dir: ./build/html
destination_dir: ${{ inputs.PR_NUMBER }}
- name: Add comment to PR
uses: peter-evans/create-or-update-comment@7dfe4b0aa0c4bbd06d172692ff8a9e18381d6979 # v3.0.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ inputs.PR_NUMBER }}
body: |
Newest code from ${{ inputs.TRIGGERING_ACTOR }} has been published to [preview environment](http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/${{ inputs.PR_NUMBER }}) for Git SHA ${{ inputs.COMMIT_SHA }}