File tree Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Expand file tree Collapse file tree 1 file changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Devcontainer to GHCR
2
+
3
+ on :
4
+ push :
5
+ branches : [main]
6
+ paths :
7
+ - ' .devcontainer/Dockerfile'
8
+ - ' .github/workflows/publish-devcontainer.yml'
9
+ workflow_dispatch :
10
+
11
+ env :
12
+ REGISTRY : ghcr.io
13
+ IMAGE_NAME : ${{ github.repository }}/devcontainer
14
+
15
+ jobs :
16
+ publish-devcontainer :
17
+ runs-on : ubuntu-latest
18
+ permissions :
19
+ contents : read
20
+ packages : write
21
+
22
+ steps :
23
+ - name : Checkout repository
24
+ uses : actions/checkout@v4
25
+
26
+ - name : Set up Docker Buildx
27
+ uses : docker/setup-buildx-action@v3
28
+
29
+ - name : Log in to Container Registry
30
+ uses : docker/login-action@v3
31
+ with :
32
+ registry : ${{ env.REGISTRY }}
33
+ username : ${{ github.actor }}
34
+ password : ${{ secrets.GITHUB_TOKEN }}
35
+
36
+ - name : Extract metadata
37
+ id : meta
38
+ uses : docker/metadata-action@v5
39
+ with :
40
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41
+ tags : |
42
+ type=ref,event=branch
43
+ type=sha,prefix={{branch}}-
44
+ type=raw,value=latest,enable={{is_default_branch}}
45
+
46
+ - name : Build and push devcontainer image
47
+ uses : docker/build-push-action@v6
48
+ with :
49
+ context : .
50
+ file : .devcontainer/Dockerfile
51
+ push : true
52
+ tags : ${{ steps.meta.outputs.tags }}
53
+ labels : ${{ steps.meta.outputs.labels }}
54
+ cache-from : type=gha
55
+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments