Waterfall view for a trace #2717
Workflow file for this run
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: Publish Production Docker Images | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, synchronize] | |
release: | |
types: [published] | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
publish-docker: | |
name: Publish Production Docker Image | |
strategy: | |
matrix: | |
container: ['frontend', 'backend'] | |
runs-on: buildjet-4vcpu-ubuntu-2204 | |
timeout-minutes: 30 | |
env: | |
IMAGE_NAME: highlight-${{ matrix.container }} | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Docker | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: Vadman97 | |
password: ${{ secrets.GH_DOCKER_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push docker container. | |
shell: bash | |
run: | | |
ANNOTATIONS="annotation-index.org.opencontainers.image.description=highlight.io production ${{ matrix.container }} image" | |
ANNOTATIONS="$ANNOTATIONS,annotation-index.org.opencontainers.image.source=https://github.com/highlight/highlight" | |
ANNOTATIONS="$ANNOTATIONS,annotation-index.org.opencontainers.image.licenses=Apache 2.0" | |
IMAGE_TAG=$(echo ${{ github.ref_name }} | sed 's/\//-/g') | |
push="--push -t ghcr.io/highlight/$IMAGE_NAME:$IMAGE_TAG" | |
if [[ ${{ github.event_name }} == 'release' ]]; then | |
push="${push} -t ghcr.io/highlight/$IMAGE_NAME:latest" | |
fi | |
# build docker image with common environment | |
pushd docker | |
source env.sh --go-docker | |
popd | |
docker buildx build $BUILD_ARGS \ | |
--build-arg REACT_APP_COMMIT_SHA=${{ github.sha }} \ | |
$push \ | |
--platform linux/arm64,linux/amd64 \ | |
-f docker/${{ matrix.container }}.Dockerfile \ | |
--target ${{ matrix.container }}-prod \ | |
--output "type=image,name=target,$ANNOTATIONS" . |