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 : Build and push to Docker Hub
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ env :
9+ REGISTRY : docker.io
10+
11+ jobs :
12+ build-and-push :
13+ runs-on : ubuntu-latest
14+ environment : master
15+ permissions :
16+ contents : read
17+ packages : write
18+
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v4
22+
23+ - name : Set up Docker Buildx
24+ uses : docker/setup-buildx-action@v3
25+
26+ - name : Log in to Docker Hub
27+ uses : docker/login-action@v3
28+ with :
29+ username : troke12
30+ password : ${{ secrets.DOCKER_TOKEN }}
31+
32+ - name : Extract version tag
33+ id : tag
34+ run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
35+
36+ - name : Build and push backend
37+ uses : docker/build-push-action@v6
38+ with :
39+ context : ./backend
40+ file : ./backend/Dockerfile
41+ push : true
42+ tags : |
43+ troke12/refity-backend:latest
44+ troke12/refity-backend:${{ steps.tag.outputs.VERSION }}
45+
46+ - name : Build and push frontend
47+ uses : docker/build-push-action@v6
48+ with :
49+ context : ./frontend
50+ file : ./frontend/Dockerfile
51+ push : true
52+ tags : |
53+ troke12/refity-frontend:latest
54+ troke12/refity-frontend:${{ steps.tag.outputs.VERSION }}
You can’t perform that action at this time.
0 commit comments