|
11 | 11 | jobs:
|
12 | 12 |
|
13 | 13 | frontend:
|
14 |
| - runs-on: ubuntu-latest |
| 14 | + runs-on: ubuntu-latest |
15 | 15 |
|
16 |
| - steps: |
17 |
| - - name: Checkout repository |
18 |
| - uses: actions/checkout@v3 |
| 16 | + steps: |
| 17 | + - name: Checkout repository |
| 18 | + uses: actions/checkout@v3 |
19 | 19 |
|
20 |
| - - name: Set up Node |
21 |
| - uses: actions/setup-node@v3 |
22 |
| - with: |
23 |
| - node-version: '20.15.1' |
24 |
| - |
25 |
| - - name: Install dependencies |
26 |
| - run: | |
27 |
| - cd frontend/ |
28 |
| - npm install --legacy-peer-deps |
| 20 | + - name: Set up Node |
| 21 | + uses: actions/setup-node@v3 |
| 22 | + with: |
| 23 | + node-version: '20.15.1' |
| 24 | + |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + cd frontend/ |
| 28 | + npm install --legacy-peer-deps |
29 | 29 |
|
30 |
| - - name: Run tests |
31 |
| - run: | |
32 |
| - cd frontend/ |
33 |
| - npm test |
| 30 | + - name: Run tests |
| 31 | + run: | |
| 32 | + cd frontend/ |
| 33 | + npm test |
34 | 34 |
|
35 | 35 | backend:
|
36 | 36 | runs-on: ubuntu-latest
|
37 |
| - # needs: frontend |
38 | 37 |
|
39 | 38 | steps:
|
40 | 39 | - name: Checkout repository
|
41 | 40 | uses: actions/checkout@v3
|
42 | 41 |
|
43 |
| - - name: Set up go |
| 42 | + - name: Set up Go |
44 | 43 | uses: actions/setup-go@v3
|
45 | 44 | with:
|
46 | 45 | go-version: '1.23'
|
47 | 46 |
|
48 | 47 | - name: Install dependencies
|
49 | 48 | run: |
|
50 |
| - cd backend/ |
51 |
| - cd api-gateway/ |
| 49 | + cd backend/api-gateway |
52 | 50 | go mod download
|
53 |
| - cd ../ |
54 |
| - cd code-execution-service/ |
| 51 | + cd ../code-execution-service |
55 | 52 | go mod download
|
| 53 | + |
| 54 | + dockerhub-update: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + needs: [frontend, backend] |
| 57 | + steps: |
| 58 | + - name: Checkout repository |
| 59 | + uses: actions/checkout@v3 |
| 60 | + |
| 61 | + - name: Logging in to Docker Hub |
| 62 | + uses: docker/login-action@v3 |
| 63 | + with: |
| 64 | + username: ${{ vars.DOCKERHUB_USERNAME }} |
| 65 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 66 | + |
| 67 | + - name: Set up Docker Buildx |
| 68 | + uses: docker/setup-buildx-action@v3 |
| 69 | + |
| 70 | + - name: Build and push api-gateway image |
| 71 | + run: | |
| 72 | + cd backend/api-gateway |
| 73 | + docker build -t slashex/codebrewery-api-gateway:latest . |
| 74 | + docker push slashex/codebrewery-api-gateway:latest |
| 75 | +
|
| 76 | + - name: Build and push code-execution-service image |
| 77 | + run: | |
| 78 | + cd backend/code-execution-service |
| 79 | + docker build -t slashex/codebrewery-code-execution-service:latest . |
| 80 | + docker push slashex/codebrewery-code-execution-service:latest |
| 81 | +
|
| 82 | + - name: Build and push frontend image |
| 83 | + run: | |
| 84 | + cd frontend |
| 85 | + docker build -t slashex/codebrewery-frontend:latest . |
| 86 | + docker push slashex/codebrewery-frontend:latest |
0 commit comments