Add workflow to build and push Docker image to GitHub Container Registry
This commit is contained in:
parent
bb2820f7df
commit
d8c76046d8
34
.github/workflows/docker-image.yml
vendored
Normal file
34
.github/workflows/docker-image.yml
vendored
Normal file
@ -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}}
|
Loading…
x
Reference in New Issue
Block a user