-
Notifications
You must be signed in to change notification settings - Fork 9
71 lines (61 loc) · 1.92 KB
/
build-docker.yml
File metadata and controls
71 lines (61 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Build Docker Image
on:
push:
paths:
- 'daikoku/app/**'
- 'daikoku/conf/**'
- 'daikoku/build.sbt'
- 'daikoku/project/**'
- 'daikoku/javascript/src/**'
- 'daikoku/javascript/package.json'
- 'daikoku/javascript/package-lock.json'
- '.github/workflows/build-docker.yml'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: maif/daikoku
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- uses: sbt/setup-sbt@v1
- uses: coursier/cache-action@v6
- name: Install JS dependencies and build frontend
run: |
cd daikoku/javascript
rm -rf node_modules/
npm ci
npm run build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Build backend and Docker image
run: |
cd daikoku
sbt -Dsbt.color=always -Dsbt.supershell=false ';clean;compile;dist'
sbt 'docker:publishLocal'
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag and push image
run: |
docker tag maif/daikoku:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
docker tag maif/daikoku:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest