Create build-ghcr-docker-image.yml
This builds a docker image and pushes it to the GitHub container registry using the default (repo owner) tokens - but only when a new git tag is pushed.
This commit is contained in:
parent
07fe36c72a
commit
b494c38885
1 changed files with 27 additions and 0 deletions
27
.github/workflows/build-ghcr-docker-image.yml
vendored
Normal file
27
.github/workflows/build-ghcr-docker-image.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
name: Build Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Login to Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Build and Push Docker Image
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
context: .
|
||||||
|
tags: |
|
||||||
|
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
|
||||||
|
ghcr.io/${{ github.repository }}:latest
|
||||||
Loading…
Reference in a new issue