mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +00:00
Create aws.yml
This commit is contained in:
parent
e8e6366bde
commit
d0efa2ffa3
1 changed files with 33 additions and 0 deletions
33
.github/workflows/aws.yml
vendored
Normal file
33
.github/workflows/aws.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
name: Push to AWS ECR
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: ['Docker Image CI']
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ secrets.AWS_REGION}}
|
||||||
|
|
||||||
|
- name: Login to Amazon ECR
|
||||||
|
id: login-ecr
|
||||||
|
uses: aws-actions/amazon-ecr-login@v1
|
||||||
|
|
||||||
|
- name: Pull image from GHCR
|
||||||
|
run: docker pull ghcr.io/${{ github.repository }}/spring-petclinic:latest
|
||||||
|
|
||||||
|
- name: Tag the image for ECR
|
||||||
|
run: docker tag ghcr.io/${{ github.repository }}/spring-petclinic:latest ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/spring-petclinic:latest
|
||||||
|
|
||||||
|
- name: Push image to Amazon ECR
|
||||||
|
run: docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/spring-petclinic:latest
|
Loading…
Reference in a new issue