forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (74 loc) · 3.04 KB
/
deploy-docs-site.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
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
name: Deploy docs.airbyte.com
on:
push:
branches:
- master
paths:
- "docs/**"
- "docusaurus/**"
pull_request:
types:
- closed
- opened
- reopened
- synchronize
paths:
- "docs/**"
- "docusaurus/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-deploy-docs:
name: Build and Deploy Docs Assets
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
fetch-depth: 0
# Node.js is needed for Yarn
- name: Setup Yarn
uses: actions/setup-node@v3
with:
node-version: "16.14.0"
cache: "yarn"
cache-dependency-path: docusaurus
- name: Run Docusaurus
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT_APPROVINGTON_OCTAVIA }}
run: |-
export SKIP_DEPLOY="yes"
if [ "${{github.event_name}}" = 'push' -o "${{github.event_name}}" = 'workflow_dispatch' -o "${{github.event.pull_request.merged}}" = 'true' ]; then
export SKIP_DEPLOY="no"
fi
./tools/bin/deploy_docusaurus
- name: Notify Slack -- deploy failed
if: always() && ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && job.status != 'success'
uses: abinoda/slack-action@master
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
with:
# 'C02TYDSUM8F' => '#dev-deploys'
# 'C03BEADRPNY' => '#docs'
args: >-
{\"channel\":\"C03BEADRPNY\",\"attachments\":[
{\"color\":\"#ff0000\",\"blocks\":[
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"OSS Docs deploy fails on the latest master :bangbang:\"}},
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"_merged by_: *${{ github.actor }}*\"}},
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"<https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|View Action Run>\"}}
]}]}
- name: Notify Slack -- deploy succeeded
if: always() && ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && job.status == 'success'
uses: abinoda/slack-action@master
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
with:
# 'C02TYDSUM8F' => '#dev-deploys'
# 'C03BEADRPNY' => '#docs'
args: >-
{\"channel\":\"C03BEADRPNY\",\"attachments\":[
{\"color\":\"#00ff00\",\"blocks\":[
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"OSS Docs deploy was successful :tada:\"}},
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"_merged by_: *${{ github.actor }}*\"}},
{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"<https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|View Action Run>\"}}
]}]}