-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (51 loc) · 1.58 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
name: Deploy to S3
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: s3deploy
timeout-minutes: 5
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete --exclude '.git*/*'
env:
SOURCE_DIR: './'
AWS_S3_BUCKET: ${{ secrets.S3_BUCKET }}
AWS_REGION: ${{ secrets.S3_BUCKET_REGION }}
invalidate:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: CFinvalidate
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
PATHS: '/'
AWS_REGION: 'us-west-2'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
notify:
needs: invalidate
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: Schema Deployment
SLACK_ICON: https://assets.verida.io/s3.png
SLACK_TITLE: Deployment of ${{ github.event.repository.name }} schemas complete
SLACK_FOOTER: Generated on merge to ${{ github.event.repository.name }}