fix #2037
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: Push Remote Dev | |
on: | |
push: | |
tags: | |
- "*rdev" | |
- "rdev*" | |
branches: | |
- "rdev-*" | |
- "**/rdev-*" | |
- "**-rdev" | |
env: | |
DEPLOYMENT_STAGE: test | |
# Force using BuildKit instead of normal Docker, required so that metadata | |
# is written/read to allow us to use layers of previous builds as cache. | |
DOCKER_BUILDKIT: 1 | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
DOCKER_REPO: ${{ secrets.ECR_REPO }}/ | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build_push_images: | |
strategy: | |
matrix: | |
image: | |
- frontend # pushed both the frontend and backend images | |
- upload_failures | |
- upload_success | |
- dataset_submissions | |
- processing | |
- wmg_processing | |
- cellguide_pipeline | |
runs-on: ubuntu-22.04 | |
outputs: | |
image_tag: ${{ steps.push_images.outputs.image_tag }} | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-region: us-west-2 | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
role-duration-seconds: 1800 | |
- name: Login to ECR | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ secrets.ECR_REPO }} | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Install happy | |
uses: chanzuckerberg/github-actions/.github/actions/install-happy@install-happy-v1.4.2 | |
with: | |
happy_version: "0.92.0" | |
- name: Push images | |
id: push_images | |
run: | | |
echo "HAPPY_COMMIT=$(git rev-parse --verify HEAD)" >> envfile | |
echo "HAPPY_BRANCH=$(git branch --show-current)" >> envfile | |
export IMAGE_TAG=sha-${GITHUB_SHA:0:7} | |
export BRANCH_TAG=branch-$(echo ${GITHUB_REF_NAME} | sed 's/[\+\/]/-/g') | |
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_OUTPUT | |
happy push devstack --env dev --slice ${{ matrix.image }} \ | |
--docker-compose-env-file envfile --aws-profile "" \ | |
--tags ${STACK_NAME},${IMAGE_TAG},${BRANCH_TAG} | |
summarize: | |
runs-on: ubuntu-22.04 | |
needs: build_push_images | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Create Summary With Happy Commands | |
run: | | |
export | |
echo "### Happy Commands :rocket: :upside_down_face:" >> $GITHUB_STEP_SUMMARY | |
echo "* \`happy create <_stack-name_> --tag ${{ needs.build_push_images.outputs.image_tag }} --create-tag=false --skip-check-tag\`" >> $GITHUB_STEP_SUMMARY | |
echo "* \`happy update <_stack-name_> --tag ${{ needs.build_push_images.outputs.image_tag }} --create-tag=false --skip-check-tag\`" >> $GITHUB_STEP_SUMMARY |