File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ # Manually trigger image build and push.
2+ name : Update Image
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag :
7+ description : Tag for the new image
8+ required : true
9+ jobs :
10+ build-and-push-image :
11+ if : ${{ github.repository == 'codewars/ocaml' }}
12+ name : Build Images
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+ packages : write
17+ steps :
18+ - uses : actions/checkout@v2
19+
20+ - name : Get image tag
21+ run : |
22+ # Remove `v` prefix if given
23+ tag=${{ github.event.inputs.tag }}
24+ echo "IMAGE_TAG=${tag#v}" >> $GITHUB_ENV
25+ shell : bash
26+
27+ - name : Set up Docker Buildx
28+ uses : docker/setup-buildx-action@v1
29+
30+ - name : Login to GitHub Container Registry
31+ uses : docker/login-action@v1
32+ with :
33+ registry : ghcr.io
34+ username : ${{ github.repository_owner }}
35+ password : ${{ secrets.GITHUB_TOKEN }}
36+
37+ - name : Build and push image
38+ uses : docker/build-push-action@v2
39+ with :
40+ context : .
41+ push : true
42+ tags : |
43+ ghcr.io/${{ github.repository }}:latest
44+ ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
45+ cache-from : type=gha
46+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments