-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a002e67
commit cfceb16
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
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 | ||
|
||
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 |