diff --git a/.github/workflows/docker-ghcr.yml b/.github/workflows/docker-ghcr.yml new file mode 100644 index 0000000..d96597a --- /dev/null +++ b/.github/workflows/docker-ghcr.yml @@ -0,0 +1,29 @@ +name: Build and Push to GHCR + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4.2.2 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3.5.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Docker image + run: | + docker build -t ghcr.io/${{ github.repository_owner }}/cal_counter:latest . + + - name: Push Docker image + run: | + docker push ghcr.io/${{ github.repository_owner }}/cal_counter:latest