Skip to content

Commit 6cf2323

Browse files
feat: pre-build Docker image and push to Docker Hub for faster setup
- Add GitHub Actions workflow to build/push image on Dockerfile changes - Update compose.yaml to pull pre-built bakerlinklab/bakerlink-env:latest - Add .github/ to cargo-generate ignore list to protect ${{ }} syntax Agent-Logs-Url: https://github.com/Baker-link-Lab/bakerlink_tutorial_template/sessions/a073b2f3-6935-476b-be2a-58f9cef53054 Co-authored-by: Baker-Tanaka <42606588+Baker-Tanaka@users.noreply.github.com>
1 parent 07be4ef commit 6cf2323

3 files changed

Lines changed: 43 additions & 5 deletions

File tree

.docker/compose.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
services:
22
{{project-name}}:
3-
build:
4-
context: .
5-
dockerfile: Dockerfile
6-
image: "baker-link-env"
3+
image: "bakerlinklab/bakerlink-env:latest"
74
container_name: "{{project-name}}-container"
85
volumes:
96
- "../:/{{project-name}}"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- '.docker/Dockerfile'
8+
workflow_dispatch:
9+
10+
env:
11+
DOCKER_IMAGE: bakerlinklab/bakerlink-env
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Login to Docker Hub
26+
# Requires repository secrets: DOCKERHUB_USERNAME and DOCKERHUB_TOKEN
27+
uses: docker/login-action@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
- name: Build and push
33+
uses: docker/build-push-action@v6
34+
with:
35+
context: .docker
36+
file: .docker/Dockerfile
37+
push: true
38+
tags: |
39+
${{ env.DOCKER_IMAGE }}:latest
40+
cache-from: type=gha
41+
cache-to: type=gha,mode=max

cargo-generate.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[template]
2-
ignore = ["README.md", "LICENSE"]
2+
ignore = ["README.md", "LICENSE", ".github/"]

0 commit comments

Comments
 (0)