-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (52 loc) · 1.68 KB
/
ci.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
# name: Build and deploy sit
on:
push:
branches:
- main
jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
container: swift:5.10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build site
run: swift run
- name: Configure AWS credentials
id: cred
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: 'us-east-1'
- name: Deploy to AWS Cloudformation
id: clouddeploy
uses: aws-actions/[email protected]
with:
name: serversideswift-conf-site
template: deploy/stack.yaml
no-fail-on-empty-changeset: "1"
parameter-overrides: >-
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: 'www.serversideswift.info'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
SOURCE_DIR: 'Output'
if: steps.clouddeploy.outcome == 'success'
- name: Invalidate CloudFront
uses: awact/cloudfront-action@master
env:
SOURCE_PATH: '/*'
AWS_REGION: 'us-east-1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }}