diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..fdecb63 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,33 @@ +name: Build & Push Docker image to GHCR + +on: + push: + branches: [main] # or your default branch + workflow_dispatch: # allow manual trigger + +permissions: + contents: read + packages: write # needed to push to GHCR + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Docker image + run: | + docker build -t ghcr.io/${{ github.repository_owner }}/class-compass-server-mini:latest . + + - name: Push image to GHCR + run: | + docker push ghcr.io/${{ github.repository_owner }}/class-compass-server-mini:latest