Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

ci: build both yt:backend and tk:backend with docker as CI step #778

Draft
wants to merge 2 commits into
base: daily
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/gh_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
ref:
description: 'The commit to checkout (on master)'
required: true
env:
YT_IMAGE_NAME: yt-backend
TK_IMAGE_NAME: tk-backend

jobs:
build:
Expand Down Expand Up @@ -54,6 +57,44 @@ jobs:
yarn guardoni build:app
yarn ycai build

docker_backends:
steps:
- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Build & Push TK Backend image
run: |
VERSION=${{ steps.version.outputs.version }}
TK_IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$TK_IMAGE_NAME
echo $IMAGE_ID
docker build . --file Dockerfile.tkbackend --tag $TK_IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"

# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $TK_IMAGE_NAME $TK_IMAGE_ID:$VERSION
docker push $TK_IMAGE_ID:$VERSION

- name: Build & Push YT Backend image
run: |
VERSION=${{ steps.version.outputs.version }}
YT_IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$YT_IMAGE_NAME
echo $IMAGE_ID
docker build . --file Dockerfile.ytbackend --tag $YT_IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"

# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $YT_IMAGE_NAME $YT_IMAGE_ID:$VERSION
docker push $YT_IMAGE_ID:$VERSION

guardoni_build:
name: Guardoni build
needs: [build]
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/master_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ permissions:
contents: write

jobs:

build:
name: Build
runs-on: ubuntu-latest
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/tk_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
- "packages/**"
- "platforms/tktrex/**"

env:
TK_IMAGE_NAME: tk-backend

jobs:
pull_request:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -65,3 +68,12 @@ jobs:
yarn pm2 start platforms/tktrex/backend/ecosystem.config.js --env test
yarn tk:backend test --runInBand --ci --forceExit
yarn pm2 stop all

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Build TK Backend image
run: docker build . --file Dockerfile.tkbackend --tag $TK_IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"


Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
- "shared/**"
- "platforms/yttrex/**"

env:
YT_IMAGE_NAME: yt-backend

jobs:
pull_request:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -71,3 +74,10 @@ jobs:
yarn yt:backend test --runInBand --forceExit --ci
yarn pm2 stop all

- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Build TK Backend image
run: docker build . --file Dockerfile.ytbackend --tag $YT_IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"