File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Image
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+
7+ jobs :
8+ build :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4
14+
15+ - name : Set up Docker Buildx
16+ uses : docker/setup-buildx-action@v3
17+
18+ - name : Login to Docker Hub
19+ uses : docker/login-action@v3
20+ with :
21+ username : ${{ secrets.DOCKERHUB_USERNAME }}
22+ password : ${{ secrets.DOCKERHUB_TOKEN }}
23+
24+ - name : Login to GHCR
25+ uses : docker/login-action@v3
26+ with :
27+ registry : ghcr.io
28+ username : ${{ github.actor }}
29+ password : ${{ secrets.GITHUB_TOKEN }}
30+
31+ - name : Build and push images
32+ uses : docker/build-push-action@v6
33+ with :
34+ push : true
35+ tags : |
36+ ${{ secrets.DOCKERHUB_USERNAME }}/centralized-logging:latest
37+ ghcr.io/${{ github.repository_owner }}/centralized-logging:latest
You can’t perform that action at this time.
0 commit comments