-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.68 KB
/
publish.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
64
65
# This is a basic workflow that is manually triggered
name: Publish
on:
workflow_dispatch:
workflow_call:
workflow_run:
workflows:
- Build
types:
- completed
env:
production_bucket: docs.threatx.com
staging_bucket: docs-staging.threatx.com
region: us-east-1
jobs:
stage:
# The type of runner that the job will run on
runs-on: ubuntu-latest
environment: staging
steps:
- name: Download build artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yml
- name: Upload site
uses: bwcxyk/s3-sync-action@1.0.0
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ env.staging_bucket }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.region }}
SOURCE_DIR: 'public'
release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: [stage]
environment: production
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yml
- name: Upload
uses: bwcxyk/s3-sync-action@1.0.0
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ env.production_bucket }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.region }}
SOURCE_DIR: 'public'