File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Docker container
2+
3+ on :
4+ push :
5+ branches :
6+ - main # or the default branch of your repository
7+
8+ jobs :
9+ build-and-push :
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : read
13+ packages : write
14+
15+ steps :
16+ - name : Check out the repo
17+ uses : actions/checkout@v3
18+
19+ - name : Get short SHA
20+ id : short-sha
21+ run : echo "::set-output name=sha::$(echo $GITHUB_SHA | cut -c1-6)"
22+
23+ - name : Log in to GitHub Container Registry
24+ uses : docker/login-action@v2
25+ with :
26+ registry : ghcr.io
27+ username : ${{ github.repository_owner }}
28+ password : ${{ secrets.GITHUB_TOKEN }}
29+
30+ - name : Build and push Docker image
31+ uses : docker/build-push-action@v6
32+ with :
33+ context : .
34+ file : ./Dockerfile
35+ push : true
36+ tags : |
37+ ghcr.io/${{ github.repository }}/resourcespace:latest
38+ ghcr.io/${{ github.repository }}/resourcespace:${{ steps.short-sha.outputs.sha }}
You can’t perform that action at this time.
0 commit comments