Merge pull request #2 from slashexx/preview #49
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.15.1' | |
- name: Install dependencies | |
run: | | |
cd frontend/ | |
npm install --legacy-peer-deps | |
- name: Run tests | |
run: | | |
cd frontend/ | |
npm test | |
backend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.23' | |
- name: Install dependencies | |
run: | | |
cd backend/api-gateway | |
go mod download | |
cd ../code-execution-service | |
go mod download | |
dockerhub-update: | |
runs-on: ubuntu-latest | |
needs: [frontend, backend] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Logging in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push api-gateway image | |
run: | | |
cd backend/api-gateway | |
docker build -t slashex/codebrewery-api-gateway:latest . | |
docker push slashex/codebrewery-api-gateway:latest | |
- name: Build and push code-execution-service image | |
run: | | |
cd backend/code-execution-service | |
docker build -t slashex/codebrewery-code-execution-service:latest . | |
docker push slashex/codebrewery-code-execution-service:latest | |
- name: Build and push frontend image | |
run: | | |
cd frontend | |
docker build -t slashex/codebrewery-frontend:latest . | |
docker push slashex/codebrewery-frontend:latest |