diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..ba28ac3 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,34 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + + - uses: docker/login-action@v2.2.0 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + + - uses: docker/metadata-action@v4.6.0 + id: meta + with: + images: ghcr.io/groceries + + - uses: docker/build-push-action@v4.1.1 + with: + context: . + push: true + tags: ${{steps.meta.outputs.tags}} + labels: ${{steps.meta.outputs.labels}}