-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.66 KB
/
release.yaml
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
name: Releases
on:
push:
tags:
- v*.*.*
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
cache: true
- run: go build -ldflags="-X 'main.Version=${{ github.ref_name }}'" -o sls-local-server main.go
name: Build
- run: echo ${{github.ref_name}} > version.txt
name: Set version file
- name: Configure DEV AWS credentials
if: endsWith(github.ref_name, '-dev')
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_KEY }}
aws-region: us-east-1
- name: Configure PROD AWS credentials
if: ${{ !endsWith(github.ref_name, '-dev') }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.PROD_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload to AWS if dev tag
if: endsWith(github.ref_name, '-dev')
run: |
aws s3 cp sls-local-server s3://rutvik-test-script/
aws s3 cp version.txt s3://rutvik-test-script/
- name: Upload to PROD AWS if not dev tag
if: ${{ !endsWith(github.ref_name, '-dev') }}
run: |
aws s3 cp sls-local-server s3://local-sls-server-runpodinc/
aws s3 cp version.txt s3://local-sls-server-runpodinc/