-
-
Notifications
You must be signed in to change notification settings - Fork 21
43 lines (41 loc) · 1.43 KB
/
Copy pathdeploy.yml
File metadata and controls
43 lines (41 loc) · 1.43 KB
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
name: Build and deploy vapor.codes
on:
push:
branches:
- main
permissions:
contents: read
id-token: write
jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Install latest Swift
uses: vapor/swiftly-action@bedb227456c5f495afbef80baebee17a8a02cef4 # v0.2.1
with:
toolchain: latest
- name: Checkout
uses: actions/checkout@v7
- name: Build site
run: swift run VaporWebsite
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@254c19bd240aabef8777f48595e9d2d7b972184b # v6.2.1
with:
role-to-assume: ${{ vars.OIDC_ROLE_ARN }}
aws-region: ${{ vars.OIDC_ROLE_REGION }}
- name: Deploy to AWS Cloudformation
uses: aws-actions/aws-cloudformation-github-deploy@81e3b03d2266bcb76c4bcc37a7d71d9cb67838bb # v2.2.0
with:
name: vapor-main-site-stack
template: stack.yml
parameter-overrides: >-
DomainName=vapor.codes,
S3BucketName=vapor-main-site,
AcmCertificateArn=${{ secrets.CERTIFICATE_ARN }}
- name: Deploy Site to S3
run: |
aws s3 sync ./site 's3://vapor-main-site/' --no-progress --acl public-read --follow-symlinks --delete
- name: Invalidate CloudFront
run: |
aws cloudfront create-invalidation --distribution-id '${{ secrets.DISTRIBUTION_ID }}' --paths '/*'