diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4a24736..523e702 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,14 +24,28 @@ jobs: - name: Deploy uses: ./ + continue-on-error: true # Ignore dry run error with: - cli-version: v0.5.38 + cli-version: v0.5.40 config-env-vars: "DEFANG_GH_ACTION_TEST_MESSAGE" cwd: "./test" compose-files: "compose.yaml compose.prod.yaml" + behavior: "staging" env: DEFANG_GH_ACTION_TEST_MESSAGE: ${{ secrets.MESSAGE }} DEFANG_INTERNAL_TEST: dfng-test + - name: Deploy-Empty-Params + uses: ./ + continue-on-error: true # Ignore dry run error + with: + cli-version: v0.5.40 + config-env-vars: "" + cwd: "./test" + compose-files: "" + behavior: "" + env: + DEFANG_INTERNAL_TEST: dfng-test + - name: Teardown run: defang config rm DEFANG_GH_ACTION_TEST_MESSAGE diff --git a/action.yaml b/action.yaml index c839465..e05e515 100644 --- a/action.yaml +++ b/action.yaml @@ -22,6 +22,10 @@ inputs: description: "The compose files to deploy. Format 'file1 file2 file3'" required: false default: "" + behavior: + description: "The behavior of the deployment. Options: 'development', 'staging', 'production'" + required: false + default: "development" runs: using: "composite" @@ -53,9 +57,14 @@ runs: params+=("-f") params+=("$filename") done + if [[ -n "${{ inputs['behavior'] }}" ]]; then + params+=("--behavior=${{ inputs['behavior'] }}") + fi + if [[ "${DEFANG_INTERNAL_TEST}" == "dfng-test" ]]; then - echo defang compose "${params[@]}" config - defang compose "${params[@]}" config + # `defang compose up --dry-run` is used for testing as --behavior flag is only available to the "compose up" command + echo defang compose "${params[@]}" up --dry-run + defang compose "${params[@]}" up --dry-run else echo defang compose "${params[@]}" up defang compose "${params[@]}" up