File tree Expand file tree Collapse file tree 2 files changed +95
-0
lines changed
Expand file tree Collapse file tree 2 files changed +95
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Docker Build
2+
3+ on :
4+ push :
5+ branches : [main]
6+
7+ jobs :
8+ build :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout
12+ uses : actions/checkout@v5
13+
14+ - name : Set up Docker Buildx
15+ uses : docker/setup-buildx-action@v3
16+ with :
17+ version : latest
18+ buildkitd-flags : --debug
19+
20+ - name : Cache Docker layers
21+ uses : actions/cache@v4
22+ with :
23+ path : ${{ runner.temp }}/.buildx-cache
24+ key : ${{ runner.os }}-buildx-${{ github.sha }}
25+ restore-keys : |
26+ ${{ runner.os }}-buildx-
27+
28+ - name : Build
29+ run : |
30+ buildx build -t kratos-selfservice-wasm:latest \
31+ --cache-from type=local,src=${{ runner.temp }}/.buildx-cache \
32+ --cache-to type=local,dest=${{ runner.temp }}/.buildx-cache-new,mode=max .
33+
34+ - name : Move cache
35+ run : |
36+ rm -rf ${{ runner.temp }}/.buildx-cache
37+ mv ${{ runner.temp }}/.buildx-cache-new ${{ runner.temp }}/.buildx-cache
Original file line number Diff line number Diff line change 1+ name : Docker Build
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*.*.*"
7+ workflow_dispatch :
8+ inputs :
9+ version_tag :
10+ description : ' Version tag'
11+ required : true
12+ type : string
13+
14+ jobs :
15+ publish :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Docker meta
19+ id : meta
20+ uses : docker/metadata-action@v5
21+ with :
22+ # list of Docker images to use as base name for tags
23+ images : |
24+ jeseng/kratos-selfservice-wasm
25+ # generate Docker tags based on the following events/attributes
26+ tags : |
27+ type=schedule
28+ type=ref,event=branch
29+ type=ref,event=pr
30+ type=semver,pattern={{version}}
31+ type=semver,pattern={{major}}.{{minor}}
32+ type=semver,pattern={{major}}
33+ type=sha
34+
35+ - name : Login to Docker Hub
36+ uses : docker/login-action@v3
37+ with :
38+ username : ${{ vars.DOCKERHUB_USERNAME }}
39+ password : ${{ secrets.DOCKERHUB_TOKEN }}
40+
41+ - name : Set up Docker Buildx
42+ uses : docker/setup-buildx-action@v3
43+ with :
44+ version : latest
45+
46+ - name : Validate build configuration
47+ uses : docker/build-push-action@v6
48+ with :
49+ call : check
50+
51+ - name : Build and push
52+ uses : docker/build-push-action@v6
53+ with :
54+ push : true
55+ tags : ${{ steps.meta.outputs.tags }}
56+ labels : ${{ steps.meta.outputs.labels }}
57+ cache-from : type=gha
58+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments