forked from bitwarden/help
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.73 KB
/
build.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
name: Build
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6
- name: Set up Jekyll
run: gem install bundler jekyll jekyll-redirect-from
- name: Print environment
run: |
node --version
npm --version
ruby --version
jekyll --version
- name: Checkout repo
uses: actions/checkout@v2
- name: Install Node dependencies
run: npm install
- name: Build site
if: github.ref != 'refs/heads/master'
run: npm run build:prod
- name: Build site for S3
if: github.ref == 'refs/heads/master'
run: npm run build:prod:sub
- name: Deploy to S3
if: github.ref == 'refs/heads/master'
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
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: '_site'
DEST_DIR: 'help'
- name: Deploy to staging
if: github.ref == 'refs/heads/staging'
uses: SamKirkland/[email protected]
env:
FTP_SERVER: ${{ secrets.STAGING_FTP_SERVER }}
FTP_USERNAME: ftpuser
FTP_PASSWORD: ${{ secrets.STAGING_FTP_PASSWORD }}
METHOD: sftp
PORT: 22
LOCAL_DIR: '_site'
REMOTE_DIR: help
ARGS: --delete