diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76328e0..d420d5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,11 @@ -name: Docker Image CI +name: Action Image CI on: workflow_dispatch: + inputs: + push: + type: boolean + default: false release: pull_request: branches: [ "main" ] @@ -17,12 +21,12 @@ jobs: - name: Build the Docker image run: docker build . --file Dockerfile --tag ghcr.io/greentf/utp:latest - name: Authenticate with GHCR - if: github.event_name == 'release' + if: ${{ github.event_name == 'release' || github.event.inputs.push == 'true' }} uses: docker/login-action@v2.1.0 with: registry: ghcr.io username: greentf - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.GHCR_TOKEN }} - name: Push container - if: github.event_name == 'release' + if: ${{ github.event_name == 'release' || github.event.inputs.push == 'true' }} run: docker push ghcr.io/greentf/utp:latest