-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (68 loc) · 2.14 KB
/
ci-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
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
name: CI-docs
on:
workflow_dispatch:
push:
branches:
- develop
pull_request:
branches:
- develop
# workflow_dispatch:
# Inputs the workflow accepts.
#inputs:
# name:
# # Friendly description to be shown in the UI instead of 'name'
# description: 'Variable'
# # Default value if no value is explicitly provided
# default: 'None'
# # Input has to be provided for the workflow to run
# required: true
env:
S3_BUCKET: dtccplatform
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
#- name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: 16
- name: Install dependencies and build
run:
#pwd && ls -alt && ls bin/ && cd bin/ && cat build-docs
#./bin/build-docs && cd website && ls && npm install && npm run build && ls
#&& cd website && npm install && npm run build
pwd && sudo apt-get install python3-opengl&& export "DEB_PYTHON_INSTALL_LAYOUT=deb_system" && pip install . && ls -alt && cd docs && ls -alt && pip install sphinx_immaterial && make #&& cd sphinx && ls -alt && make html
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: build
path: docs/build/
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: build
path: docs/build/
- name: Setup AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-north-1
- name: Deploy to S3
run: |
pwd
ls -altR
cd docs/build
aws s3 ls s3://$S3_BUCKET
aws s3 sync . s3://$S3_BUCKET
aws cloudfront create-invalidation --distribution-id E2X21HEI2MF4EQ --paths "/*"