Skip to content

chore:staging<-main (#637) #273

chore:staging<-main (#637)

chore:staging<-main (#637) #273

name: Deploy Explorer (Happy)
on:
push:
branches:
- main
- staging
- prod
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_REPO: ${{ secrets.ECR_REPO }}/
permissions:
id-token: write
contents: read
jobs:
upgrade:
runs-on: ubuntu-20.04
steps:
- name: Configure AWS Prod Credentials
uses: aws-actions/configure-aws-credentials@v2
if: github.ref == 'refs/heads/prod'
with:
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@v2
if: github.ref != 'refs/heads/prod'
with:
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: Setup envfile
run: |
mkdir /home/runner/work/custom
touch /home/runner/work/custom/envfile
echo "HAPPY_COMMIT=$(git rev-parse --verify HEAD)" > /home/runner/work/custom/envfile
- name: Update deployment
uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@deploy-happy-stack-v1.7.2
with:
tfe-token: ${{ secrets.TFE_TOKEN }}
stack-name: explorer-${{ env.DEPLOYMENT_STAGE }}stack
create-tag: "true"
env: ${{ env.DEPLOYMENT_STAGE }}
env-file: /home/runner/work/custom/envfile
happy_version: "0.79.1"