diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml new file mode 100644 index 0000000..2205bcc --- /dev/null +++ b/.github/workflows/build-image.yml @@ -0,0 +1,31 @@ +name: Build image +on: + push: + branches: ["main"] +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Docker Setup Buildx + uses: docker/setup-buildx-action@v2.2.1 + - 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 + uses: docker/build-push-action@v3 + with: + context: . + file: Dockerfile + push: true + tags: "ghcr.io/${{ github.repository }}/main:latest"