Skip to content

Bump github.com/apple/swift-argument-parser from 1.3.1 to 1.4.0 in th… #442

Bump github.com/apple/swift-argument-parser from 1.3.1 to 1.4.0 in th…

Bump github.com/apple/swift-argument-parser from 1.3.1 to 1.4.0 in th… #442

Workflow file for this run

name: deploy bot stack
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push: { branches: [main] }
jobs:
deploy:
name: Deploy Stack
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.DEPLOYER_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEPLOYER_ACCESS_SECRET_KEY }}
aws-region: "eu-west-1"
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: penny-bot-discord-image
IMAGE_TAG: ${{ github.sha }}
run: |
# Build a docker container and
# push it to ECR so that it can
# be deployed to ECS.
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f Dockerfile .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Fill in the new image ID in the Amazon ECS task definition
id: task-def
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition: ./deploy/penny-discord-bot-task.json
container-name: penny-bot
image: ${{ steps.build-image.outputs.image }}
- name: Deploy to Amazon ECS Service
id: task-dep
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
with:
task-definition: ${{ steps.task-def.outputs.task-definition }}
wait-for-service-stability: true
- name: Deploy to AWS cloudformation
uses: aws-actions/aws-cloudformation-github-deploy@v1
with:
name: penny-discord-bot-stack
template: ./deploy/penny-discord-bot-stack.yml
no-fail-on-empty-changeset: "1"
parameter-overrides: >-
TaskDefinition=${{ steps.task-dep.outputs.task-definition-arn }}