-
Notifications
You must be signed in to change notification settings - Fork 37
50 lines (48 loc) · 1.54 KB
/
deploy-docs.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
---
name: Production Documentation
on:
workflow_dispatch:
#push:
# tags:
# - '*'
# - '!**beta**'
# - '!**alpha**'
# - '!**tatum**'
jobs:
deploy:
name: Build and deploy documentation to production
environment:
name: production
url: https://docs.streamr.network
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
cache-dependency-path: 'package-lock.json'
- name: Install dependencies
run: npm run bootstrap
- name: Build documentation
working-directory: ./docs
run: npm ci && npm run build
- name: Get version string from git tag name
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Print version string
run: echo ${{ steps.get_version.outputs.VERSION }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_KEY_PROD_DOCS }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_PROD_DOCS }}
aws-region: eu-west-1
- name: Deploy to S3
working-directory: ./docs
run: |
aws s3 sync build/. s3://docs.streamr.network --acl private
- name: Invalidate Cloudfront cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CF_DISTRIBUTION_ID_PROD_DOCS }} --paths "/*"