Skip to content

Workflow file for this run

name: Publish Docker image to ghcr.io
on:
push:
branches:
- main
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build -f Dockerfile -t watch-hf .
- name: Tag and push images
run: |
docker tag watch-hf:latest ghcr.io/${{ github.repository_owner }}/watch-hf:${{ github.sha }}
docker push ghcr.io/${{ github.repository_owner }}/watch-hf:${{ github.sha }}
docker tag watch-hf:latest ghcr.io/${{ github.repository_owner }}/watch-hf:latest
docker push ghcr.io/${{ github.repository_owner }}/watch-hf:latest