-
Notifications
You must be signed in to change notification settings - Fork 152
47 lines (45 loc) · 1.53 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
name: Build and push CLI doc to S3
on:
pull_request:
push:
branches:
- master
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
environment: actions # Is this necessary if we use the "env:" context below ?
steps:
- uses: actions/checkout@v4
- name: prepare temporary folder for build
run: |
cd docs
mkdir docs
ls
cp commands/* docs/
cp -r static_files/* docs/
- name: Pull Material for MKdocs image and build doc
run: |
docker pull squidfunk/mkdocs-material
docker run --rm -i -v ${PWD}/docs:/docs squidfunk/mkdocs-material build
- name: Download and set up AWS CLI
run: |
sudo apt-get update
sudo apt-get install -y awscli
- name: Sety up AWS credentials
env:
CLI_DOC_ACCESS_KEY: ${{ secrets.CLI_DOC_ACCESS_KEY }}
CLI_DOC_SECRET_KEY: ${{ secrets.CLI_DOC_SECRET_KEY }}
run: |
aws configure set aws_access_key_id $CLI_DOC_ACCESS_KEY
aws configure set aws_secret_access_key $CLI_DOC_SECRET_KEY
aws configure set region nl-ams
- name: Upload file to Scaleway Object Storage
env:
CLI_DOC_BUCKET_NAME: ${{ secrets.CLI_DOC_BUCKET_NAME }}
CLI_DOC_S3_ENDPOINT: ${{ secrets.CLI_DOC_S3_ENDPOINT }}
run: |
aws s3 cp --recursive ./docs/site/ s3://$CLI_DOC_BUCKET_NAME --endpoint-url $CLI_DOC_S3_ENDPOINT
- name: Delete temporary folder
run: rm -rf docs/docs/