File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - " [0-9]+.[0-9]+"
7+
8+ jobs :
9+ build-and-push :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Check out the repo
13+ uses : actions/checkout@v3
14+
15+ - name : Set up Docker Buildx
16+ uses : docker/setup-buildx-action@v2
17+
18+ - name : Log in to Docker Hub
19+ uses : docker/login-action@v2
20+ with :
21+ username : ${{ secrets.DOCKERHUB_USERNAME }}
22+ password : ${{ secrets.DOCKERHUB_TOKEN }}
23+
24+ - name : Extract tag name
25+ id : tag
26+ run : echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
27+
28+ - name : Build and push Docker image
29+ uses : docker/build-push-action@v4
30+ with :
31+ context : .
32+ push : true
33+ tags : |
34+ ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:${{ steps.tag.outputs.TAG }}
35+ ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}:latest
You can’t perform that action at this time.
0 commit comments