-
-
Notifications
You must be signed in to change notification settings - Fork 946
109 lines (90 loc) · 2.89 KB
/
website.yml
File metadata and controls
109 lines (90 loc) · 2.89 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Website Build"
on:
push:
branches:
- "master"
jobs:
typescript-check:
name: "TypeScript check"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
- name: "Install Node"
uses: "actions/setup-node@v1"
with:
node-version: "13"
- name: "Cache dependencies"
uses: "actions/cache@v1"
with:
path: "$(yarn cache dir)"
key: "${{ runner.os }}-yarn-${{ hashFiles('website/**/yarn.lock') }}"
restore-keys: "${{ runner.os }}-yarn-"
- name: "Install dependencies"
working-directory: ./website
run: "yarn install"
- name: "TypeScript check"
working-directory: ./website
run: "yarn run check"
build:
name: "Build"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
- name: "Install Node"
uses: "actions/setup-node@v1"
with:
node-version: "13"
- name: "Cache dependencies"
uses: "actions/cache@v1"
with:
path: "$(yarn cache dir)"
key: "${{ runner.os }}-yarn-${{ hashFiles('website/**/yarn.lock') }}"
restore-keys: "${{ runner.os }}-yarn-"
- name: "Install dependencies"
working-directory: ./website
run: "yarn install"
- name: "Build"
working-directory: ./website
run: "yarn run build"
- name: "Upload website dist"
uses: actions/upload-artifact@v1
with:
name: website-dist
path: website/dist
deploy:
name: "Deploy"
needs:
- typescript-check
- build
runs-on: "ubuntu-latest"
steps:
- name: "Install Node"
uses: "actions/setup-node@v1"
with:
node-version: "13"
- name: "Download website dist"
uses: actions/download-artifact@v1
with:
name: website-dist
path: dist
- name: "Sync with S3"
uses: jakejarvis/s3-sync-action@v0.5.1
with:
args: --exclude '.git*/*' --delete --follow-symlinks
env:
SOURCE_DIR: './dist'
AWS_REGION: 'eu-west-1'
AWS_S3_BUCKET: "web-phpstan.org"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: "Invalidate CloudFront"
uses: chetan/invalidate-cloudfront-action@v1.2
env:
DISTRIBUTION: "E1W83FJ5FCYXPT"
PATHS: '/,/r/*,/config-reference,/user-guide/*,/writing-php-code/*,/developing-extensions/*,/blog,/blog/*,/robots.txt,/sitemap.xml,/rss.xml'
AWS_REGION: 'eu-west-1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}