|
6 | 6 | workflow_dispatch:
|
7 | 7 |
|
8 | 8 | jobs:
|
| 9 | + build-frontend: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + if: github.event_name != 'pull_request' |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + id-token: write |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v4 |
| 18 | + - name: "Install Rust Toolchain" |
| 19 | + uses: actions-rs/toolchain@v1 |
| 20 | + with: |
| 21 | + toolchain: stable |
| 22 | + - name: "Install Node" |
| 23 | + uses: actions/setup-node@v3 |
| 24 | + with: |
| 25 | + node-version: 20 |
| 26 | + - run: rustup target add wasm32-unknown-unknown |
| 27 | + working-directory: frontend |
| 28 | + - run: npm i |
| 29 | + working-directory: frontend |
| 30 | + - run: npm run wasm |
| 31 | + working-directory: frontend |
| 32 | + - run: npm run build |
| 33 | + working-directory: frontend |
| 34 | + - name: Upload built files |
| 35 | + uses: actions/upload-artifact@v3 |
| 36 | + with: |
| 37 | + name: built-frontend |
| 38 | + path: ./frontend/dist |
| 39 | + |
9 | 40 | publish-images:
|
10 | 41 | runs-on: ubuntu-latest
|
| 42 | + needs: build-frontend |
11 | 43 | if: github.event_name != 'pull_request'
|
12 | 44 | permissions:
|
13 | 45 | contents: read
|
|
18 | 50 | service_name:
|
19 | 51 | - "backend"
|
20 | 52 | - "frontend"
|
| 53 | + include: |
| 54 | + - service_name: backend |
| 55 | + docker_file: backend/Dockerfile |
| 56 | + - service_name: frontend |
| 57 | + docker_file: frontend/Dockerfile.pre-built |
21 | 58 | steps:
|
22 | 59 | - name: Checkout
|
23 |
| - uses: actions/checkout@v3 |
| 60 | + uses: actions/checkout@v4 |
| 61 | + - name: Download built files |
| 62 | + uses: actions/download-artifact@v3 |
| 63 | + with: |
| 64 | + name: built-frontend |
| 65 | + path: ./frontend/dist |
24 | 66 | - name: Docker meta
|
25 | 67 | id: meta
|
26 | 68 | uses: docker/metadata-action@v4
|
|
46 | 88 | uses: docker/build-push-action@v4
|
47 | 89 | with:
|
48 | 90 | context: ./${{ matrix.service_name }}
|
| 91 | + file: ${{ matrix.docker_file }} |
49 | 92 | platforms: linux/amd64,linux/arm64
|
50 | 93 | push: ${{ github.event_name != 'pull_request' }}
|
51 | 94 | tags: ${{ steps.meta.outputs.tags }}
|
|
0 commit comments