diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9708ae8..be9ac70 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,6 +1,7 @@ name: Docker NodeJS Images GitHub workflow on: + workflow_dispatch: pull_request: branches: - 'master' @@ -65,7 +66,7 @@ jobs: - uses: actions/checkout@v1 - name: Login to DockerHub # Merge ~ push. - if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} + if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/build-and-test.sh b/build-and-test.sh index c083297..99cf24c 100755 --- a/build-and-test.sh +++ b/build-and-test.sh @@ -38,7 +38,7 @@ RESULT=`docker run --rm -e CRON_SCHEDULE_1="* * * * * * *" -e CRON_COMMAND_1="wh echo "Tests passed with success" -if [[ "$EVENT_NAME" == "push" || "$EVENT_NAME" == "schedule" ]]; then +if [[ "$EVENT_NAME" == "push" || "$EVENT_NAME" == "schedule" || "$EVENT_NAME" == "workflow_dispatch" ]]; then docker buildx build --platform=linux/amd64,linux/arm64 --push -t thecodingmachine/nodejs:${TAG} -f Dockerfile.${VARIANT} . docker login ghcr.io --username ${GITHUB_ACTOR} --password ${GITHUB_TOKEN}