-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (78 loc) · 2.57 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
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
# This is a basic workflow that is manually triggered
name: Publish
on:
workflow_dispatch:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.8.0
uses: actions/setup-node@v4
with:
node-version: 22.8.0
- name: Install Ruby Dependencies
run: |
sudo apt-get update && sudo apt-get install -y software-properties-common
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update && sudo apt-get install -y rvm
source /etc/profile.d/rvm.sh
rvm install 3.3.5
rvm use 3.3.5
bundle config set path '.bundle/gems'
bundle
- name: Install Node Dependencies
run: npm install
- name: Generate Site
run: |
source /etc/profile.d/rvm.sh
rvm use 3.3.5
npx antora --fetch --stacktrace antora-playbook.yml
echo "-------- Build output: ------------"
ls -alh public
- name: Upload Site Files Build Artifact
id: artifact-upload-step
uses: actions/upload-artifact@v4.3.3
with:
name: public
path: public/*
if-no-files-found: error
stage:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: build
environment: staging
steps:
- name: Download build artifacts
uses: dawidd6/action-download-artifact@v6
- name: Upload site
uses: bwcxyk/s3-sync-action@1.0.0
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: docs-staging.threatx.com
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
SOURCE_DIR: 'public'
release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: [build,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
- name: Upload
uses: bwcxyk/s3-sync-action@1.0.0
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: docs.threatx.com
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
SOURCE_DIR: 'public'