From f3871497dd4a1758da4adedf223ea12592247341 Mon Sep 17 00:00:00 2001 From: Jeffrey Tse Date: Mon, 17 Jul 2023 17:07:34 +0800 Subject: [PATCH] feat: add test provider to skip deployment --- .github/workflows/deploy-test.yml | 2 +- entrypoint.sh | 4 ++-- providers/test.sh | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100755 providers/test.sh diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml index c0db5282..c3a47945 100644 --- a/.github/workflows/deploy-test.yml +++ b/.github/workflows/deploy-test.yml @@ -18,6 +18,6 @@ jobs: ${{ runner.os }}-gems- - uses: ./ with: - provider: 'github' + provider: 'test' token: ${{ secrets.GITHUB_TOKEN }} jekyll_src: './test_site' diff --git a/entrypoint.sh b/entrypoint.sh index e810888f..c0e838cd 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -136,8 +136,8 @@ cd ${WORKING_DIR}/build # Check if deploy on the same repository branch PROVIDER_EXIT_CODE=0 -if [[ "${PROVIDER}" == "github" ]]; then - source "${SCRIPT_DIR}/providers/github.sh" +if [[ -f "${SCRIPT_DIR}/providers/${PROVIDER}.sh" ]]; then + source "${SCRIPT_DIR}/providers/${PROVIDER}.sh" else echo "${PROVIDER} is an unsupported provider." PROVIDER_EXIT_CODE=1 diff --git a/providers/test.sh b/providers/test.sh new file mode 100755 index 00000000..4f85d9e8 --- /dev/null +++ b/providers/test.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +# Check if deploy to same branch +echo "This is just for deployment test." + +PROVIDER_EXIT_CODE=$?