Skip to content

Commit b93d6a4

Browse files
authored
Create deploy.yml
1 parent 1b6ddb7 commit b93d6a4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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/sonichigo/wallpaper-ai:${{ github.sha }} .
26+
- name: Push Docker image
27+
run: |
28+
docker push ghcr.io/sonichigo/wallpaper-ai:${{ github.sha }}
29+
- name: Tag latest image
30+
run: |
31+
docker tag ghcr.io/sonichigo/wallpaper-ai:${{ github.sha }} ghcr.io/sonichigo/wallpaper-ai:latest
32+
- name: Push the "latest" tag
33+
run: |
34+
docker push ghcr.io/sonichigo/wallpaper-ai:latest

0 commit comments

Comments
 (0)