File tree Expand file tree Collapse file tree 4 files changed +78
-2
lines changed Expand file tree Collapse file tree 4 files changed +78
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy to AWS
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ workflow_dispatch :
8
+
9
+ jobs :
10
+ build-and-deploy :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Checkout repository
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Setup Node.js
17
+ uses : actions/setup-node@v3
18
+ with :
19
+ node-version : ' 18'
20
+ cache : ' npm'
21
+
22
+ - name : Install Node.js dependencies
23
+ run : npm ci
24
+
25
+ - name : Run Gulp tasks
26
+ run : npx gulp
27
+
28
+ - name : Setup Ruby
29
+ uses : ruby/setup-ruby@v1
30
+ with :
31
+ ruby-version : ' 3.2'
32
+ bundler-cache : true
33
+
34
+ - name : Build Jekyll site
35
+ run : bundle exec jekyll build
36
+
37
+ - name : Configure AWS credentials
38
+ uses : aws-actions/configure-aws-credentials@v2
39
+ with :
40
+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
41
+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
42
+ aws-region : us-east-1
43
+
44
+ - name : Deploy to S3
45
+ run : aws s3 sync ./_site/ s3://learn-english.dev --delete
46
+
47
+ - name : Invalidate CloudFront cache
48
+ run : |
49
+ aws cloudfront create-invalidation \
50
+ --distribution-id ${{ secrets.DISTRIBUTION_ID }} \
51
+ --paths "/*"
52
+
53
+ - name : Send Slack notification
54
+
55
+ with :
56
+ payload : |
57
+ {
58
+ "text": "🚀 程序员英语词汇宝典已成功部署!",
59
+ "blocks": [
60
+ {
61
+ "type": "section",
62
+ "text": {
63
+ "type": "mrkdwn",
64
+ "text": "*程序员英语词汇宝典已成功部署!* 🚀\n网站: <https://learn-english.dev|learn-english.dev>"
65
+ }
66
+ }
67
+ ]
68
+ }
69
+ env :
70
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK }}
71
+ SLACK_WEBHOOK_TYPE : INCOMING_WEBHOOK
File renamed without changes.
Original file line number Diff line number Diff line change 1
- name : Build & Deploy
1
+ name: Deploy to AWS
2
2
3
3
on:
4
4
push:
Original file line number Diff line number Diff line change 9
9
"dependencies" : {
10
10
"autoprefixer" : " ^10.4.14" ,
11
11
"postcss" : " ^8.4.24" ,
12
- "tailwindcss" : " ^3.3.2"
12
+ "tailwindcss" : " ^3.3.2" ,
13
+ "gulp" : " ^4.0.2" ,
14
+ "gulp-load-plugins" : " ^2.0.8" ,
15
+ "gulp-cache-bust" : " ^1.4.1" ,
16
+ "gulp-htmlmin" : " ^5.0.1" ,
17
+ "gulp-clean-css" : " ^4.3.0"
13
18
},
14
19
"engines" : {
15
20
"node" : " >=18.0.0"
You can’t perform that action at this time.
0 commit comments