Skip to content

Commit

Permalink
PRSD-752: Makes pipeline create task definition (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis-Softwire authored Jan 14, 2025
1 parent cf89c99 commit 538f04a
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
contents: read
env:
AWS_REGION: "eu-west-2"
outputs:
image_name: ${{ steps.build-image.outputs.image_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -69,9 +71,26 @@ jobs:
IMAGE=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker tag prsdb-webapp:latest $IMAGE
docker push $IMAGE
echo "image_name=$IMAGE" >> $GITHUB_OUTPUT
# ToDo PRSD-752: Update task definition and redeploy ECS service
update-task-definition:
name: Update task definition
needs: build-and-deploy
permissions:
id-token: write
contents: read
uses: communitiesuk/prsdb-infra/.github/workflows/update-task-definition.yml@main
with:
environment_name: integration
account_id: 794038239680
image_name: ${{ needs.build-and-deploy.outputs.image_name }}

# ToDo PRSD-752: Redeploy ECS service

report-pipeline-status:
runs-on: ubuntu-latest
needs: update-task-definition
steps:
- name: Report pipeline status
if: always() && github.event_name == 'push' && github.ref == 'refs/heads/main'
id: slack
Expand All @@ -80,8 +99,8 @@ jobs:
payload: |
{
"commit": ${{ toJson(github.event.head_commit.message) }},
"result": "${{ job.status == 'success' && 'Success :tick:' || 'Failure :no-cross:' }}",
"result": "${{ (needs.update-task-definition.result == 'success' || needs.update-task-definition.result == 'skipped') && 'Success :tick:' || 'Failure :no-cross:' }}",
"url": "${{ format('https://github.com/communitiesuk/prsdb-webapp/actions/runs/{0}', github.run_id) }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

0 comments on commit 538f04a

Please sign in to comment.