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