This repository has been archived by the owner on Jun 22, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (63 loc) · 2.11 KB
/
deploy.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
name: Build and deploy blog.vapor.codes
on:
push:
branches:
- main
jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Install mkdocs
run: |
pip3 install mkdocs mkdocs-material
- name: Checkout
uses: actions/checkout@v2
- name: Build Site
run: |
cd 4.0;
mkdocs build;
cd ..;
rm -rf site
mkdir -p site;
mv 4.0/site site/4.0;
echo "<meta http-equiv=\"refresh\" content=\"0; url=/4.0/\">" > site/index.html;
- name: Configure AWS credentials
id: cred
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DOCS_DEPLOYER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DOCS_DEPLOYER_AWS_SECRET_ACCESS_KEY }}
aws-region: 'eu-west-2'
- name: Deploy to AWS Cloudformation
id: clouddeploy
uses: aws-actions/aws-cloudformation-github-deploy@v1.0.3
with:
name: vapor-docs-cn-stack
template: stack.yaml
no-fail-on-empty-changeset: "1"
parameter-overrides: >-
DomainName=cn.docs.vapor.codes,
S3BucketName=vapor-docs-cn-site,
AcmCertificateArn=${{ secrets.CERTIFICATE_ARN }}
if: steps.cred.outcome == 'success'
- name: Deploy to S3
id: s3deploy
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: 'vapor-docs-cn-site'
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOYER_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOYER_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-west-2'
SOURCE_DIR: 'site'
if: steps.clouddeploy.outcome == 'success'
- name: Invalidate CloudFront
uses: awact/cloudfront-action@master
env:
SOURCE_PATH: '/*'
AWS_REGION: 'eu-west-2'
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOYER_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOYER_AWS_SECRET_ACCESS_KEY }}
DISTRIBUTION_ID: ${{ secrets.CN_DOCS_DISTRIBUTION_ID }}