-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (57 loc) · 2.39 KB
/
deploy-docs.yaml
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
name: Deploy docs application
on:
repository_dispatch:
types: [docs-production]
jobs:
deploy:
name: Deploy docs to AWS
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.18.1
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.26.3
- name: Remove root pnpm files
run: rm ./pnpm-lock.yaml ./package.json ./pnpm-workspace.yaml
shell: bash
- name: Installing dependencies
working-directory: apps/docs
run: pnpm i --frozen-lockfile --prefer-offline
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Build docs
working-directory: apps/docs
run: pnpm build
- name: Deploy to S3 and invalidate Cloudfront
uses: reggionick/s3-deploy@v4
with:
folder: ./apps/docs/build
bucket: ${{ secrets.DOCS_AWS_S3_BUCKET }}
bucket-region: ${{ secrets.AWS_REGION }}
dist-id: ${{ secrets.DOCS_AWS_CLOUDFRONT_DISTRIBUTION_ID }}
invalidation: /
delete-removed: true
private: true
filesToInclude: '**/*'
- name: Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: dashboard-deployment
SLACK_MESSAGE: 'Just deployed docs'
SLACK_TITLE: 'Deployment'
SLACK_USERNAME: 'Yazif Deployer'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL_DASHBOARD_DEPLOYMENT }}
MSG_MINIMAL: true