Skip to content

Commit

Permalink
feat: allow workflow_dispatch to push built image (#18)
Browse files Browse the repository at this point in the history
* feat: add input to workflow dispatch

* Update build.yml

* Update build.yml

* Update build.yml

* Update build.yml
  • Loading branch information
AnActualEmerald authored Apr 22, 2023
1 parent f078723 commit b338183
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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" ]
Expand All @@ -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

0 comments on commit b338183

Please sign in to comment.