-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add stable promotion workflow and dev deployment
- Add workflow to tag images as stable in ECR and update ECS service in production. - Add workflow for automatic deployment to dev after each release. - Rename `deploy` job to `publish` in `release.yml` for clarity. - Grant write permissions to issues and PRs in release job.
- Loading branch information
Showing
3 changed files
with
80 additions
and
7 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,45 @@ | ||
name: Promote Version to Stable | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Enter the version to promote as stable (e.g., 1.0.0)" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
env: | ||
ECR_REGISTRY: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com | ||
|
||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.GH_ROLE }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Pull the selected version of the image | ||
run: | | ||
docker pull ${{ env.ECR_REGISTRY }}/pillarbox-event-dispatcher:${{ github.event.inputs.version }} | ||
- name: Tag the image as stable | ||
run: | | ||
docker tag ${{ env.ECR_REGISTRY }}/pillarbox-event-dispatcher:${{ github.event.inputs.version }} ${{ env.ECR_REGISTRY }}/pillarbox-event-dispatcher:stable | ||
docker push ${{ env.ECR_REGISTRY }}/pillarbox-event-dispatcher:stable | ||
- name: ECS deployment | ||
run: > | ||
aws ecs update-service \ | ||
--cluster pillarbox-monitoring-cluster \ | ||
--service dispatch-service \ | ||
--force-new-deployment \ | ||
--region ${{ secrets.AWS_REGION }} >/dev/null |
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
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