Promote Version to Stable #1
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
name: Promote Version to Stable | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Enter the version tag to promote as stable (e.g., v1.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-monitoring-transfer:${{ github.event.inputs.version }} | |
- name: Tag the image as stable | |
run: | | |
docker tag ${{ env.ECR_REGISTRY }}/pillarbox-monitoring-transfer:${{ github.event.inputs.version }} ${{ env.ECR_REGISTRY }}/pillarbox-monitoring-transfer:stable | |
docker push ${{ env.ECR_REGISTRY }}/pillarbox-monitoring-transfer:stable | |
- name: ECS deployment | |
run: > | |
aws ecs update-service \ | |
--cluster pillarbox-monitoring \ | |
--service data-transfer-service \ | |
--force-new-deployment \ | |
--region ${{ secrets.AWS_REGION }} |