-
-
Notifications
You must be signed in to change notification settings - Fork 330
60 lines (60 loc) · 2.07 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
name: Build and deploy the Vapor documentation
on:
push:
branches:
- main
jobs:
deploy:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Build the website
run: |
mkdocs build
swift fixSearchIndex.swift
cp googlefc012e5d94cfa05f.html site/googlefc012e5d94cfa05f.html;
swift setUpRedirects.swift
- 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
if: steps.cred.outcome == 'success'
uses: aws-actions/[email protected]
with:
name: vapor-docs-stack
template: stack.yml
no-fail-on-empty-changeset: "1"
parameter-overrides: >-
DomainName=docs.vapor.codes,
S3BucketName=vapor-docs-site,
AcmCertificateArn=${{ secrets.CERTIFICATE_ARN }}
- name: Deploy to S3
id: s3deploy
if: steps.clouddeploy.outcome == 'success'
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: 'vapor-docs-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'
- 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.DOCS_DISTRIBUTION_ID }}