v9.6 Docs #12428
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: preview-env-setup-update | |
on: | |
pull_request: | |
types: [assigned, opened, reopened, synchronize] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Setup Python | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
uses: actions/setup-python@db9987b4c1f10f0404fa60ee629f675fafbd6763 # v4.6.0 | |
with: | |
python-version: '3.9' | |
- name: Install pipenv | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
run: pip install pipenv | |
- name: Install dependencies | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
run: pipenv install --dev | |
- name: Build | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
run: make SPHINXOPTS="-j auto -D mm_url_path_prefix=/${{ steps.pr.outputs.id }}" html | |
- uses: shallwefootball/s3-upload-action@4350529f410221787ccf424e50133cbc1b52704e # v1.3.3 | |
name: Upload Preview Env | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
with: | |
aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_bucket: ${{ secrets.AWS_BUCKET }} | |
source_dir: ./build/html | |
destination_dir: ${{ github.event.number }} | |
- name: Add comment to PR | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
uses: peter-evans/create-or-update-comment@7dfe4b0aa0c4bbd06d172692ff8a9e18381d6979 # v3.0.1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
issue-number: ${{ github.event.number }} | |
body: | | |
Newest code from ${{ github.actor }} has been published to [preview environment](http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/${{ github.event.number }}) for Git SHA ${{ github.event.pull_request.head.sha }} |