Skip to content

Commit

Permalink
chore: ECS ci/cd (#251)
Browse files Browse the repository at this point in the history
* ci/cd for ecs

* tests

* Comment slack failures

* Install happy client

* Try GHA action

* test

* Refactor

* Changes

* fixes
  • Loading branch information
ebezzi authored May 13, 2022
1 parent 78f36b5 commit 25070e1
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/deploy-happy-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy Explorer (Happy)

on:
push:
branches:
- main
- staging
- prod

env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_REPO: ${{ secrets.ECR_REPO }}/

jobs:
upgrade:
runs-on: ubuntu-20.04
steps:
- name: Configure AWS Prod Credentials
uses: aws-actions/configure-aws-credentials@v1
if: github.ref == 'refs/heads/prod'
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_PROD_ROLE_TO_ASSUME }}
role-duration-seconds: 900
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
if: github.ref != 'refs/heads/prod'
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 900
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: ${{ secrets.ECR_REPO }}
- uses: actions/checkout@v2
- name: Set deployment stage variable
run : |
if [[ "${{ github.ref }}" == "refs/heads/prod" ]]; then
echo "DEPLOYMENT_STAGE=prod" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/staging" ]]; then
echo "DEPLOYMENT_STAGE=stage" >> $GITHUB_ENV
else
echo "DEPLOYMENT_STAGE=dev" >> $GITHUB_ENV
fi
- name: Install happy client
uses: chanzuckerberg/github-actions/.github/actions/install-happy@v1.2.1
- name: Update deployment
uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@v1.2.1
with:
tfe-token: ${{ secrets.TFE_TOKEN }}
stack-name: explorer-${{ env.DEPLOYMENT_STAGE }}stack
happy_version: "0.17.0"
create-tag: "true"
env: ${{ env.DEPLOYMENT_STAGE }}

0 comments on commit 25070e1

Please sign in to comment.