Add GitHub Actions workflow to build Docker image
This commit is contained in:
parent
667e6e388e
commit
408942999f
1 changed files with 27 additions and 0 deletions
27
.github/workflows/docker.yml
vendored
Normal file
27
.github/workflows/docker.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
run: |
|
||||
IMAGE=ghcr.io/${{ github.repository }}
|
||||
docker build -t $IMAGE:latest .
|
||||
docker push $IMAGE:latest
|
||||
Loading…
Reference in a new issue