-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 2.16 KB
/
deploiy_aws.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
55
56
57
58
59
60
61
62
63
name: deploy-aws
on:
workflow_dispatch:
inputs:
keyId:
description: 'You can override the AWS access key id, or keep it empty to use the default from the secrets'
required: false
default:
secretAccessKey:
description: 'You can override the AWS secret access key, or keep it empty to use the default from the secrets'
required: false
default:
env:
# server
IMAGE: reearth/reearth:nightly
IMAGE_AWS: reearth-test-server:latest
# web
IMAGE_CLASSIC_WEB: reearth/reearth-classic-web:nightly
IMAGE_CLASSIC_WEB_AWS: reearth-classic-web-test-server:latest
jobs:
deploy_server:
name: Deploy server to AWS
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID || github.events.inputs.keyId }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY || github.events.inputs.secretAccessKey }}
aws-region: us-west-2
- name: Log in to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: docker pull, push to ECR
run: |
docker pull $IMAGE
docker tag $IMAGE ${{ steps.login-ecr.outputs.registry }}/$IMAGE_AWS
docker push ${{ steps.login-ecr.outputs.registry }}/$IMAGE_AWS
deploy_web:
name: Deploy web to AWS
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID || github.events.inputs.keyId }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY || github.events.inputs.secretAccessKey }}
aws-region: us-west-2
- name: Log in to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: docker pull, push to ECR
run: |
docker pull $IMAGE_CLASSIC_WEB
docker tag $IMAGE_CLASSIC_WEB ${{ steps.login-ecr.outputs.registry }}/$IMAGE_CLASSIC_WEB_AWS
docker push ${{ steps.login-ecr.outputs.registry }}/$IMAGE_CLASSIC_WEB_AWS