Skip to content

Commit d154b69

Browse files
committed
ci: build toturial dockerfile
1 parent 29f3a4d commit d154b69

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build code-server Docker Image
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths:
7+
- './tutorial/Dockerfile'
8+
- './tutorial/root/**'
9+
- '.github/workflows/build-docker-tutorial.yml'
10+
11+
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Docker metadata
22+
uses: docker/metadata-action@v5
23+
id: metadata
24+
with:
25+
images: |
26+
ghcr.io/${{ github.repository_owner }}/bootcamp
27+
tags: |
28+
tutorial
29+
labels: |
30+
maintainer=${{ github.repository_owner }}
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: Log in to GitHub Container Registry
36+
uses: docker/login-action@v3
37+
with:
38+
registry: ghcr.io
39+
username: ${{ github.repository_owner }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Build and push Docker image
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: tutorial
46+
platforms: linux/amd64
47+
push: ${{ github.ref == 'refs/heads/master' }}
48+
tags: ${{ steps.metadata.outputs.tags }}
49+
labels: ${{ steps.metadata.outputs.labels }}

0 commit comments

Comments
 (0)