-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (93 loc) · 3.29 KB
/
Copy pathci.yml
File metadata and controls
113 lines (93 loc) · 3.29 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
name: CI
on:
push:
branches: [ master, dev ]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
# Skip CI build if this is a tag push (handled by release workflow)
if: startsWith(github.ref, 'refs/tags/') == false
env:
GO111MODULE: on
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22.x'
- name: Install Dependencies
run: make GOBIN=$HOME/gopath/bin deps
- name: Run Tests
run: make GOBIN=$HOME/gopath/bin test
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Create Python Virtual Environment
run: python -m venv .pyvenv
- name: Run API Unit Tests
run: make api-test
- name: Run Coverage Tests
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
$HOME/gopath/bin/goveralls -v -service=github
- name: Build Project
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
run: make GOBIN=$HOME/gopath/bin build
- name: Build Docker Image
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev'
run: docker build -t clintsharp/gogen .
# Deployment steps only run on dev branch; production deploys are handled by release.yml
- name: Configure AWS Credentials
if: github.ref == 'refs/heads/dev'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy Build Artifacts to S3
if: github.ref == 'refs/heads/dev'
run: aws s3 sync build s3://gogen-artifacts-staging --delete
- name: Setup Node.js
if: github.ref == 'refs/heads/dev'
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Deploy UI
if: github.ref == 'refs/heads/dev'
run: |
chmod +x ui/deploy_ui.sh
ui/deploy_ui.sh -e staging
deploy-lambdas:
runs-on: ubuntu-latest
needs: build
# Production deploys are handled by release.yml on tagged commits
if: github.ref == 'refs/heads/dev'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.13'
- name: Install AWS SAM CLI
run: |
python -m pip install --upgrade pip
pip install aws-sam-cli boto3 botocore awscli
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Deploy Lambda Functions
env:
ROLE_ARN: ${{ secrets.STAGING_LAMBDA_ROLE_ARN }}
GITHUB_OAUTH_CLIENT_ID: ${{ secrets.STAGING_GITHUB_OAUTH_CLIENT_ID }}
GITHUB_OAUTH_CLIENT_SECRET: ${{ secrets.STAGING_GITHUB_OAUTH_CLIENT_SECRET }}
run: |
cd gogen-api
bash deploy_lambdas.sh -e staging