File tree Expand file tree Collapse file tree 3 files changed +56
-1
lines changed
Expand file tree Collapse file tree 3 files changed +56
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Docker CI
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ branches : [ "main" ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+ - name : Build image
16+ run : |
17+ COMMIT_HASH=$(git rev-parse --short HEAD)
18+ IMAGE_TAG=ghcr.io/${{ github.repository }}:${COMMIT_HASH}
19+ docker build . --file Dockerfile --tag $IMAGE_TAG
Original file line number Diff line number Diff line change 1+ name : Docker publish
2+
3+ on :
4+ release :
5+ types : [ created ]
6+
7+ env :
8+ REGISTRY : ghcr.io
9+ IMAGE_NAME : ${{ github.repository }}
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - uses : actions/checkout@v4
17+ - name : Login to ghcr
18+ uses : docker/login-action@v3
19+ with :
20+ registry : ${{ env.REGISTRY }}
21+ username : ${{ github.actor }}
22+ password : ${{ secrets.GITHUB_TOKEN }}
23+
24+ - name : Extract metadata for image tag
25+ id : meta
26+ uses : docker/metadata-action@v4
27+ with :
28+ images : " ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
29+
30+ - name : Build and push image
31+ uses : docker/build-push-action@v5
32+ with :
33+ context : .
34+ push : true
35+ tags : ${{ steps.meta.outputs.tags }}
36+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1- name : Rust
1+ name : Rust CI
22
33on :
44 push :
You can’t perform that action at this time.
0 commit comments