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 to GitHub Container Registry
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main # Trigger on push to the main branch
7
+
8
+ jobs :
9
+ build :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Checkout code
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Log in to GitHub Container Registry
17
+ uses : docker/login-action@v2
18
+ with :
19
+ registry : ghcr.io
20
+ username : ${{ github.actor }}
21
+ password : ${{ secrets.GITHUB_TOKEN }}
22
+
23
+ - name : Build Docker image
24
+ run : |
25
+ docker build -t ghcr.io/${{ github.repository }}/wallpaper-ai:${{ github.sha }} .
26
+
27
+ - name : Push Docker image
28
+ run : |
29
+ docker push ghcr.io/${{ github.repository }}/wallpaper-ai:${{ github.sha }}
30
+
31
+ - name : Tag latest image
32
+ run : |
33
+ docker tag ghcr.io/${{ github.repository }}/wallpaper-ai:${{ github.sha }} ghcr.io/${{ github.repository }}/wallpaper-ai:latest
34
+
35
+ - name : Push the "latest" tag
36
+ run : |
37
+ docker push ghcr.io/${{ github.repository }}/wallpaper-ai:latest
You can’t perform that action at this time.
0 commit comments