Merge pull request #8 from shenxianpeng/support-docker-image #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Image | |
on: | |
push: | |
paths: | |
- 'Dockerfile' | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Which tag want to build' | |
default: '' | |
required: false | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build to check Dockerfile | |
if: github.event.inputs.tag == '' | |
run: make image | |
- name: Build and publish docker image | |
if: github.event.inputs.tag != '' | |
run: | | |
echo "tag = ${{ github.event.inputs.tag }}" | |
make image TAG=${{ github.event.inputs.tag }} | |
echo $CR_PAT | docker login ghcr.io -u shenxianpeng --password-stdin | |
make publish-image TAG=${{ github.event.inputs.tag }} | |
env: | |
CR_PAT: ${{ secrets.CR_PAT }} |