Skip to content

Commit

Permalink
Create docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonichigo authored Dec 8, 2024
1 parent 81e332f commit 01ef53c
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Push Docker Image to GitHub Container Registry

on:
push:
branches:
- main # Trigger on push to the main branch

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to GitHub Container Registry
uses: docker/#-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}/wallpaper-ai:${{ github.sha }} .
- name: Push Docker image
run: |
docker push ghcr.io/${{ github.repository }}/wallpaper-ai:${{ github.sha }}
- name: Tag latest image
run: |
docker tag ghcr.io/${{ github.repository }}/wallpaper-ai:${{ github.sha }} ghcr.io/${{ github.repository }}/wallpaper-ai:latest
- name: Push the "latest" tag
run: |
docker push ghcr.io/${{ github.repository }}/wallpaper-ai:latest

0 comments on commit 01ef53c

Please # to comment.