-
-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (77 loc) · 3.2 KB
/
check_commit.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
# This is a basic workflow to help you get started with Actions
name: check_commit
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [none]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
release-server:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: "18.x"
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Checkout release branch
run: git checkout -b release
- name: Install & Build prod js files
run: |
npm
npm run build:server
# Runs a set of commands using the runners shell
- name: Commit and push to branch
run: |
git config user.email "[email protected]"
git config user.name "Your Name"
git add --all
git commit -am "release"
git push --set-upstream origin release --force
git push
deploy-aws:
runs-on: ubuntu-latest
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- uses: actions/checkout@v4
- name: build & deploy
run: |
yarn
cd packages/oboku-api-aws-lambda
touch .env
echo "GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID" >> .env
echo "GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET" >> .env
echo "WASABI_AWS_ACCESS_KEY=$WASABI_AWS_ACCESS_KEY" >> .env
echo "WASABI_AWS_SECRET_KEY=$WASABI_AWS_SECRET_KEY" >> .env
echo "COUCH_DB_PROXY_SECRET=$COUCH_DB_PROXY_SECRET" >> .env
echo "COUCH_DB_URL=$COUCH_DB_URL" >> .env
touch .secrets/jwt-private-key.key
echo "$JWT_PRIVATE_KEY" > .secrets/jwt-private-key.key
npm run compile
sam build
sam deploy --no-confirm-changeset --parameter-overrides\
ParameterKey=Environment,ParameterValue=PROD \
ParameterKey=WasabiAwsAcessKey,ParameterValueParameterValue==${{ secrets.WASABI_AWS_ACCESS_KEY }} \
ParameterKey=WasabiAwsSecretKey,ParameterValue=${{ secrets.WASABI_AWS_SECRET_KEY }} \
env:
JWT_PRIVATE_KEY: ${{secrets.JWT_PRIVATE_KEY}}
GOOGLE_CLIENT_ID: ${{secrets.GOOGLE_CLIENT_ID}}
GOOGLE_CLIENT_SECRET: ${{secrets.GOOGLE_CLIENT_SECRET}}
WASABI_AWS_ACCESS_KEY: ${{secrets.WASABI_AWS_ACCESS_KEY}}
WASABI_AWS_SECRET_KEY: ${{secrets.WASABI_AWS_SECRET_KEY}}
COUCH_DB_PROXY_SECRET: ${{secrets.COUCH_DB_PROXY_SECRET}}
COUCH_DB_URL: https://api.oboku.me:5985