-
Notifications
You must be signed in to change notification settings - Fork 4
55 lines (48 loc) · 1.78 KB
/
Copy pathmain.yml
File metadata and controls
55 lines (48 loc) · 1.78 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
name: Deploy Production
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Checkout Environment Repo
uses: actions/checkout@v2
with:
repository: PhoenixDAO/phoenix-dao-api-environments.git
ref: main
token: ${{ secrets.PAT_GITHUB }}
path: phoenix-env
- name: Copy Environments From Config Repo
run: |
cp phoenix-env/dao_server.config .ebextensions/02_environment.config
cp phoenix-env/dao_config.yml .elasticbeanstalk/config.yml
- name: Generate deployment package
run: zip -r application.zip * */* .sequelizerc .ebextensions/* .elasticbeanstalk/* .platform/* -x '*.git*' blocasset/*
- name: Get timestamp
uses: gerred/actions/current-time@master
id: current-time
- name: Run string replace
uses: frabert/replace-string-action@master
id: format-time
with:
pattern: '[:\.]+'
string: "${{ steps.current-time.outputs.time }}"
replace-with: '-'
flags: 'g'
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v18
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_SECRET_KEY }}
application_name: ${{ secrets.APP_NAME }}
environment_name: ${{ secrets.PROD_APP_ENVIRONMENT }}
version_label: "phoenix-dao-server-${{ steps.format-time.outputs.replaced }}"
region: ${{ secrets.AWS_REGION }}
existing_bucket_name: ${{ secrets.AWS_S3_BUCKET }}
deployment_package: application.zip
wait_for_environment_recovery: 120
wait_for_deployment: false