Deploy Docs to staging #62
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: Deploy Docs to staging | |
on: | |
push: | |
branches: | |
- development | |
workflow_dispatch: | |
jobs: | |
paths-filter: | |
runs-on: ubuntu-latest | |
outputs: | |
docs: ${{ steps.filter.outputs.docs }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
docs: | |
- 'Docs/**' | |
build-docs: | |
runs-on: ubuntu-latest | |
needs: paths-filter | |
if: needs.paths-filter.outputs.docs == 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
pip install -r "Docs/requirements.txt" | |
- name: Build docs | |
run: | | |
cd Docs | |
make html | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: DocumentationHTML | |
path: Docs/build/html | |
- uses: ravsamhq/notify-slack-action@2.3.0 | |
if: ${{ always() && github.ref_name == 'development' }} | |
with: | |
status: ${{ job.status }} | |
notification_title: "The Job *{job}* in Workflow *{workflow}* has {status_message}" | |
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>" | |
footer: "Linked Repo <{repo_url}|{repo}>" | |
notify_when: "failure" | |
mention_groups: "alttester-pipelines,!here" | |
mention_groups_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} | |
deploy-dev-docs: | |
runs-on: ubuntu-latest | |
needs: build-docs | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: DocumentationHTML | |
path: DocumentationHTML/ | |
- name: Replace URL | |
uses: jacobtomlinson/gha-find-replace@v3 | |
with: | |
find: ${{ secrets.LIVE_URL_ALTTESTER }} | |
replace: ${{ secrets.DEV_URL_ALTTESTER }} | |
regex: true | |
- name: Upload documentation | |
uses: appleboy/scp-action@v0.1.7 | |
with: | |
source: DocumentationHTML/* | |
target: ${{ secrets.DOCS_PATH_NOT_VERSIONED }} | |
host: ${{ secrets.HOST_IP_ALTTESTER }} | |
port: ${{ secrets.PORT_DEV_ALTTESTER }} | |
username: ${{ secrets.USERNAME_ALTTESTER }} | |
password: ${{ secrets.PASSWORD_ALTTESTER }} | |
rm: true | |
strip_components: 1 | |
- uses: ravsamhq/notify-slack-action@2.3.0 | |
if: ${{ always() && github.ref_name == 'development' }} | |
with: | |
status: ${{ job.status }} | |
notification_title: "The Job *{job}* in Workflow *{workflow}* has {status_message}" | |
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}@{branch}> on <{commit_url}|{commit_sha}>" | |
footer: "Linked Repo <{repo_url}|{repo}>" | |
notify_when: "failure" | |
mention_groups: "alttester-pipelines,!here" | |
mention_groups_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }} |