-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use different environment variable for instance setup #6
Conversation
@hussainweb @skippednote Can you please take a look. |
The problem is that We should explore making this an input parameter. That way, the calling job can set the branch to whatever they want. By default, we could use |
@hussainweb Agree. Makes sense. I will take a look. |
@hussainweb This can be reviewed now. |
@@ -11,7 +11,7 @@ mkdir -p ~/.ssh && chmod 0700 ~/.ssh | |||
cat ${GITHUB_ACTION_PATH}/known_hosts >> ~/.ssh/known_hosts | |||
|
|||
platform project:set-remote ${PLATFORM_PROJECT_ID} | |||
PLATFORM_OPTS="-vv --activate --target ${GITHUB_REF_NAME}" | |||
PLATFORM_OPTS="-vv --activate --target $ENVIRONMENT_NAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PLATFORM_OPTS="-vv --activate --target $ENVIRONMENT_NAME" | |
[[ "$ENVIRONMENT_NAME" == "" ]] && ENVIRONMENT_NAME="$GITHUB_REF_NAME" | |
PLATFORM_OPTS="-vv --activate --target $ENVIRONMENT_NAME" |
- | ||
name: Set environment name | ||
id: set_environment_name | ||
shell: bash | ||
run: | | ||
ENVIRONMENT_NAME=${{ inputs.environment-name }} | ||
[[ "$ENVIRONMENT_NAME" == "" ]] && ENVIRONMENT_NAME="$GITHUB_REF_NAME" | ||
echo "::set-output name=url::$ENVIRONMENT_NAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not very fond of this. I think we can handle this in the shell script itself quite robustly. See my other two suggestions.
- run: ${{ github.action_path }}/deploy.sh | ||
shell: bash | ||
env: | ||
SSH_PRIVATE_KEY: ${{ inputs.ssh-private-key }} | ||
PLATFORM_PROJECT_ID: ${{ inputs.project-id }} | ||
PLATFORMSH_CLI_TOKEN: ${{ inputs.cli-token }} | ||
FORCE_PUSH: ${{ inputs.force-push }} | ||
ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.url }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENVIRONMENT_NAME: ${{ steps.set_environment_name.outputs.url }} | |
ENVIRONMENT_NAME: ${{ inputs.environment-name }} |
- | ||
name: Set environment name | ||
id: set_environment_name | ||
shell: bash | ||
run: | | ||
ENVIRONMENT_NAME=${{ inputs.environment-name }} | ||
[[ "$ENVIRONMENT_NAME" == "" ]] && ENVIRONMENT_NAME="$GITHUB_REF_NAME" | ||
echo "::set-output name=url::$ENVIRONMENT_NAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- | |
name: Set environment name | |
id: set_environment_name | |
shell: bash | |
run: | | |
ENVIRONMENT_NAME=${{ inputs.environment-name }} | |
[[ "$ENVIRONMENT_NAME" == "" ]] && ENVIRONMENT_NAME="$GITHUB_REF_NAME" | |
echo "::set-output name=url::$ENVIRONMENT_NAME" |
Fixes #5