-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (48 loc) · 1.5 KB
/
deploy-core.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: Sharingan Deploy Core
on:
pull_request:
branches:
- main
push:
branches:
- main
- dev
paths:
- 'apps/core/src/**'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
jobs:
package:
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Copy the core Dockerfile in the root repository
run: cp apps/core/Dockerfile .
- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: public.ecr.aws/x9y5g9l2
REGION: us-east-1 # Public ECR aren't region specific
REPOSITORY: sharingan
IMAGE_TAG: latest
run: |
aws ecr-public get-login-password --region $REGION | docker login --username AWS --password-stdin $REGISTRY
docker build -t $REPOSITORY:$IMAGE_TAG .
docker tag $REPOSITORY:$IMAGE_TAG $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
deploy:
runs-on: ubuntu-latest
environment: Production
# needs:
# - package
steps:
- uses: actions/checkout@v2
- name: Deploy the application
env:
AWS_REGION: eu-west-1
run: |
touch file.json && echo '${{ secrets.CORE_APP_ARN }}' > file.json
cat file.json
aws apprunner start-deployment --region $AWS_REGION --cli-input-json file:https://file.json