mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 07:15:49 +00:00
try seperating into 2 jobs
This commit is contained in:
parent
c5de37b853
commit
6a6d35c774
1 changed files with 13 additions and 3 deletions
16
.github/workflows/docker-image.yml
vendored
16
.github/workflows/docker-image.yml
vendored
|
@ -7,8 +7,11 @@ on:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
docker-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
docker_tag: ${{ steps.meta.outputs.tags }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
#checkout repo
|
#checkout repo
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -40,7 +43,12 @@ jobs:
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
ecr-deploy:
|
||||||
|
needs: docker-build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
#push to ecr
|
#push to ecr
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v1
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
@ -55,8 +63,10 @@ jobs:
|
||||||
|
|
||||||
- name: Tag the image for ECR
|
- name: Tag the image for ECR
|
||||||
run: |
|
run: |
|
||||||
docker tag ${{ steps.meta.outputs.tags }} ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/spring-petclinic:latest
|
docker tag ${{ needs.build.outputs.docker_tag }} ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/spring-petclinic:latest
|
||||||
|
|
||||||
|
|
||||||
- name: Push image to Amazon ECR
|
- name: Push image to Amazon ECR
|
||||||
run: docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/spring-petclinic:latest
|
run: docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/spring-petclinic:latest
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue