-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (35 loc) · 981 Bytes
/
main.yaml
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
name: Deploy Knoxctl's webpage to S3
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.111.3'
extended: true
- name: Build Hugo Site
run: hugo --minify
- name: Set up AWS CLI
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_DEV_ACCESS_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEV_SECRET_ID }}
aws-region: us-east-2
- name: Deploy to S3
run: |
aws s3 sync ./public s3://www.knoxctlwebsite.accuknox.com --delete --debug
- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
PATHS: "/*"