forked from Adventech/sabbath-school-lessons
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (101 loc) · 4 KB
/
deploy.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
93
94
95
96
97
98
99
100
101
name: deploy
on:
push:
branches:
- master
- stage
paths:
- '**.js'
- 'src/**'
- 'images/**'
jobs:
deploy:
if: (github.repository == 'Adventech/sabbath-school-lessons')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Get changed files and write the outputs to a JSON file
id: changed-files-write-output-files-json
uses: tj-actions/changed-files@v39
with:
json: true
write_output_files: true
- name: Verify the contents of the .github/outputs/all_changed_files.json file
run: |
cat .github/outputs/all_changed_files.json
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- run: gpg --quiet --batch --yes --decrypt --passphrase="$CREDS_PASSPHRASE" --output deploy-creds.tar deploy-creds.tar.gpg
env:
CREDS_PASSPHRASE: ${{ secrets.CREDS_PASSPHRASE }}
- run: tar xvf deploy-creds.tar
- uses: actions/setup-node@v2
with:
node-version: '16'
check-latest: true
- name: Add token for private packages
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.PACKAGES_SECRET }}" >> .npmrc
- run: npm install
- run: node deploy -b ${{ steps.extract_branch.outputs.branch }}
- name: Web deploy
run: aws s3 cp dist/ s3://sabbath-school`[[ "${{ steps.extract_branch.outputs.branch }}" = "stage" ]] && echo '-stage'`.adventech.io --acl "public-read" --region us-east-1 --no-progress --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
deploy_v2:
if: (github.repository == 'Adventech/sabbath-school-lessons')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Get changed files and write the outputs to a JSON file
id: changed-files-write-output-files-json
uses: tj-actions/changed-files@v39
with:
json: true
write_output_files: true
- name: Verify the contents of the .github/outputs/all_changed_files.json file
run: |
cat .github/outputs/all_changed_files.json
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- run: gpg --quiet --batch --yes --decrypt --passphrase="$CREDS_PASSPHRASE" --output deploy-creds.tar deploy-creds.tar.gpg
env:
CREDS_PASSPHRASE: ${{ secrets.CREDS_PASSPHRASE }}
- run: tar xvf deploy-creds.tar
- uses: actions/setup-node@v2
with:
node-version: '16'
check-latest: true
- name: Add token for private packages
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.PACKAGES_SECRET }}" >> .npmrc
- run: npm install
- run: node deploy -b ${{ steps.extract_branch.outputs.branch }} -v 2
- name: Web deploy
run: aws s3 cp dist/ s3://sabbath-school`[[ "${{ steps.extract_branch.outputs.branch }}" = "stage" ]] && echo '-stage'`.adventech.io --acl "public-read" --region us-east-1 --no-progress --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}