Skip to content

maingockien01 is running CI on commit 007bc5306cef21429b5aab6d3929953d2499eb18 #9

maingockien01 is running CI on commit 007bc5306cef21429b5aab6d3929953d2499eb18

maingockien01 is running CI on commit 007bc5306cef21429b5aab6d3929953d2499eb18 #9

Workflow file for this run

name: CI
run-name: ${{ github.actor }} is running ${{ github.workflow }} on commit ${{ github.sha }}
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/team8:${{ github.sha }}
IS_PUSH_TO_MAIN: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker
uses: docker/setup-buildx-action@v1
- name: Build Docker image
run: docker build -t ${{ env.IMAGE_NAME }} .
- name: Log in to Docker Hub
if: ${{ env.IS_PUSH_TO_MAIN }}
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_TOKEN }}
- name: Push Docker image
if: ${{ env.IS_PUSH_TO_MAIN }}
run: docker push ${{ env.IMAGE_NAME }}
lint:
runs-on: ubuntu-latest
needs: build
concurrency:
group: lint-${{ github.sha }}
cancel-in-progress: true
steps:
- name: Run linter on workspace backend
run: docker run ${{ env.IMAGE_NAME }} yarn workspace @team8/backend lint
- name: Run linter on workspace frontend
run: docker run ${{ env.IMAGE_NAME }} yarn workspace @team8/frontend lint
- name: Run linter on workspace types
run: docker run ${{ env.IMAGE_NAME }} yarn workspace @team8/types lint
- name: Run linter on workspace constants
run: docker run ${{ env.IMAGE_NAME }} yarn workspace @team8/constants lint
- name: Run linter on workspace utils
run: docker run ${{ env.IMAGE_NAME }} yarn workspace @team8/utils lint
tests:
runs-on: ubuntu-latest
needs: build
concurrency:
group: tests-${{ github.sha }}
cancel-in-progress: true
steps:
- name: Run unit tests on backend
run: docker run ${{ env.IMAGE_NAME }} yarn workspace @team8/backend test:unit