-
Notifications
You must be signed in to change notification settings - Fork 37
/
example.yml
63 lines (55 loc) · 1.77 KB
/
example.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
name: Build and Deploy
on:
push:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- name: setup node
uses: actions/setup-node@v1
with:
node-version: "10.x"
# Run the build script which populates the ./dist folder
- name: build
run: |
yarn
yarn run build
# Merge ./dist into the 'gh-pages' branch (dist in this case)
- name: update dist branch
uses: peaceiris/actions-gh-pages@v2.3.1
env:
PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }}
PUBLISH_BRANCH: dist
PUBLISH_DIR: ./dist
# Check out the new branch
- name: checkout dist
uses: actions/checkout@master
with:
ref: dist
# Fix timestamps
- name: restore timestamps
uses: chetan/git-restore-mtime-action@release
# Upload to S3
- name: sync s3
uses: jakejarvis/s3-sync-action@2fb81a9e9fea11e078587911c27754e42e6a6e88
with:
args: --exclude '.git*/*' --delete --follow-symlinks
env:
SOURCE_DIR: "./"
AWS_REGION: "us-east-1"
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# Invalidate CloudFront (this action)
- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
PATHS: "/index.html"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}