forked from ecds/readux
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.77 KB
/
dev-depoly.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
name: Dev-Deploy
on:
workflow_run:
workflows: [Dev-Test]
types: [completed]
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout Docker configs
run: |
eval `ssh-agent -s`
ssh-add - <<< '${{ secrets.DEPLOY_KEY_FOR_CONFIG_REPO }}'
git clone -b "${{ github.head_ref || github.ref_name }}" "${{ secrets.DEPLOY_CONFIG_REPO}}"
mv "${{ secrets.CONFIG_REPO_NAME }}"/* .
chmod +x config.sh
chmod +x deploy.sh
- name: Run Config
run: ./config.sh
env:
AWS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_FSX_VOLUME: ${{ secrets.AWS_FSX_VOLUME }}
DATABASE_URL: ${{ secrets.DATABASE_URL_DEV }}
EMAIL_USER: ${{ secrets.EMAIL_USER }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
- name: Configure AWS credentials from AWS account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_DEV }}
aws-region: us-east-1
role-session-name: GitHub-OIDC-frontend
- name: Run Deploy
env:
AWS_KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_FSX_VOLUME: ${{ secrets.AWS_FSX_VOLUME }}
DATABASE_URL: ${{ secrets.DATABASE_URL_DEV}}
EMAIL_USER: ${{ secrets.EMAIL_USER }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
run: ./deploy.sh