Skip to content

Commit 33f6ad5

Browse files
committed
Switch to distroless Dockerfile
1 parent 434220d commit 33f6ad5

File tree

11 files changed

+1465
-1994
lines changed

11 files changed

+1465
-1994
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BAYBRIDGE_DIST_PATH=dist
2+
BAYBRIDGE_CHARTJS_DIST_PATH=node_modules/chart.js/dist

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
use flake
2+
dotenv

.github/workflows/docker.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,34 @@ on:
66
pull_request:
77
branches: [ "master" ]
88

9-
jobs:
9+
env:
10+
CONTAINER: baybridge
1011

11-
docker-baybridge:
12+
jobs:
13+
docker-nix:
1214
runs-on: ubuntu-latest
1315
permissions:
1416
contents: read
1517
packages: write
1618
steps:
1719
- uses: actions/checkout@v4
20+
- uses: cachix/install-nix-action@v31
21+
with:
22+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Build image
24+
run: |
25+
nix build .#docker
26+
docker load < result
1827
- name: Log in to GitHub Container Registry
1928
uses: docker/login-action@v2
2029
with:
2130
registry: ghcr.io
2231
username: ${{ github.actor }}
2332
password: ${{ secrets.GITHUB_TOKEN }}
24-
- uses: extractions/setup-just@v2
25-
- name: Build css
26-
run: just build-css
27-
- name: Build & push docker image
33+
- name: Tag & push docker image
2834
run: |
29-
docker build . --push --file Dockerfile \
30-
--tag ghcr.io/nicolaschan/baybridge:${GITHUB_REF#refs/*/}-${{ github.run_id }} \
31-
--tag ghcr.io/nicolaschan/baybridge:latest
35+
docker tag $CONTAINER:latest ghcr.io/nicolaschan/$CONTAINER:latest
36+
docker push ghcr.io/nicolaschan/$CONTAINER:latest
37+
docker tag $CONTAINER:latest ghcr.io/nicolaschan/$CONTAINER:${GITHUB_REF#refs/*/}-${{ github.run_id }}
38+
docker push ghcr.io/nicolaschan/$CONTAINER:${GITHUB_REF#refs/*/}-${{ github.run_id }}
39+

0 commit comments

Comments
 (0)