Skip to content

Commit abf0670

Browse files
committed
Docker build in github with custom base image
1 parent 11ae9b6 commit abf0670

File tree

4 files changed

+65
-86
lines changed

4 files changed

+65
-86
lines changed

.github/cloudbuild.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/docker-build.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Docker Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: "node-cleanup"
23+
run: |
24+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
25+
df -h
26+
27+
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Log in to Container Registry
32+
if: github.event_name != 'pull_request'
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ${{ env.REGISTRY }}
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Extract metadata
40+
id: meta
41+
uses: docker/metadata-action@v5
42+
with:
43+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
44+
tags: |
45+
type=ref,event=branch
46+
type=ref,event=pr
47+
type=semver,pattern={{version}}
48+
type=semver,pattern={{major}}.{{minor}}
49+
type=raw,value=latest,enable={{is_default_branch}}
50+
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v3
53+
54+
- run: df -h
55+
56+
- name: Build and push Docker image
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: .
60+
push: ${{ github.event_name != 'pull_request' }}
61+
tags: ${{ steps.meta.outputs.tags }}
62+
labels: ${{ steps.meta.outputs.labels }}
63+
cache-from: type=gha
64+
cache-to: type=gha,mode=max

.github/workflows/gcp-docker-build.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM us-docker.pkg.dev/colab-images/public/runtime:release-colab_20240626-060133_RC01
1+
FROM aberger4/mouse-tracking-test:latest
22

33
# Install uv
44
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

0 commit comments

Comments
 (0)