Bump rubocop from 1.67.0 to 1.68.0 #386
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: Deployment to Staging | |
on: | |
issue_comment: | |
types: | |
- created | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trigger deployment on comment | |
id: trigger-deployment | |
uses: shanegenschaw/pull-request-comment-trigger@v3.0.0 | |
with: | |
trigger: '@thewca-bot deploy staging' | |
reaction: rocket | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get ref from pr | |
id: comment-branch | |
uses: xt0rted/pull-request-comment-branch@v2 | |
if: steps.trigger-deployment.outputs.triggered == 'true' | |
- name: Checkout `main` branch | |
uses: actions/checkout@v4 | |
- name: Checkout PR branch | |
run: gh pr checkout $PR_NUMBER | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PR_NUMBER: ${{ github.event.issue.number }} | |
- name: Get the SHA of the current branch/fork | |
shell: bash | |
run: | | |
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV" | |
if: steps.trigger-deployment.outputs.triggered == 'true' | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
if: steps.trigger-deployment.outputs.triggered == 'true' | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.CI_CD_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.CI_CD_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | |
if: steps.trigger-deployment.outputs.triggered == 'true' | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v2 | |
if: steps.trigger-deployment.outputs.triggered == 'true' | |
- name: Build and push handler Image | |
if: steps.trigger-deployment.outputs.triggered == 'true' | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
file: dockerfile.handler | |
tags: | | |
${{ steps.login-ecr.outputs.registry }}/wca-registration-handler:staging | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: | | |
BUILD_TAG=${{ env.SHORT_SHA }} | |
- name: Build and push worker Image | |
if: steps.trigger-deployment.outputs.triggered == 'true' | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
file: dockerfile.worker | |
tags: | | |
${{ steps.login-ecr.outputs.registry }}/wca-registration-worker:staging | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: | | |
BUILD_TAG=${{ env.SHORT_SHA }} | |
- name: Deploy if triggered | |
if: steps.trigger-deployment.outputs.triggered == 'true' | |
env: | |
CLUSTER_NAME: wca-registration-staging | |
run: | | |
aws ecs update-service --cluster ${{ env.CLUSTER_NAME }} --service Staging-Service --force-new-deployment |