Skip to content

make push to ghcr.io #4

make push to ghcr.io

make push to ghcr.io #4

Workflow file for this run

name: Build Image and deploy it to GHCR
on:
push:
tags:
- "v*"
pull_request:
branches:
- "master"
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.event.repository.name }}
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push
uses: docker/build-push-action@v5
with:
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}