forked from bitmakerla/estela
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.37 KB
/
deploy-main-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: Build and Deploy the Docs
on:
push:
branches:
- main
paths:
- docs/**
workflow_dispatch:
jobs:
build_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set-up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: "./docs/"
- name: Install redoc-cli
run: |
yarn global add [email protected]
echo "$(yarn global bin)" >> $GITHUB_PATH
- name: Build Swagger Documentation
run: redoc-cli build ./estela-api/docs/api.yaml -t ./docs/assets/swagger-template.hbs --options.hideDownloadButton -o ./docs/estela/api/endpoints.html
- name: Build Site
run: |
cd ./docs
bundle exec jekyll build
env:
JEKYLL_ENV: production
- name: Configure AWS Credentials
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: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Deploy to S3 Bucket
run: aws s3 sync ./docs/_site/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/ --delete
- name: Create Cloudfront Invalidation
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"