File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and push to GHCR
2+
3+ on :
4+ push :
5+ branches :
6+ - deployment
7+
8+ concurrency :
9+ group : ${{ github.workflow }}-${{ github.ref }}
10+ cancel-in-progress : true
11+
12+ jobs :
13+ build-and-push :
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Create a SHA tag
17+ id : sha_tag
18+ run : |
19+ tag=$(cut -c 1-7 <<< $GITHUB_SHA)
20+ echo "::set-output name=tag::$tag"
21+
22+ - name : Checkout code
23+ uses : actions/checkout@v3
24+ - name : Setup Docker BuildX
25+ uses : docker/setup-buildx-action@v2
26+
27+ - name : Login to GHCR
28+ uses : docker/login-action@v2
29+ with :
30+ registry : ghcr.io
31+ username : ${{ github.repository_owner }}
32+ password : ${{ github.token }}
33+
34+ - name : Build and push
35+ uses : docker/build-push-action@v3
36+ with :
37+ context : .
38+ file : ./Dockerfile
39+ push : true
40+ cache-from : type=repository,ref=ghcr.io/python-discord/logviewer:latest
41+ cache-to : type=inline
42+ tags : |
43+ ghcr.io/python-discord/logviewer:latest
44+ ghcr.io/python-discord/logviewer:${{ steps.sha_tag.outputs.tag }}
You can’t perform that action at this time.
0 commit comments