-
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
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6da4112
use different environment variable for instance setup
subhojit777 7d93ad0
parametrize instance name
subhojit777 655f4fc
update var name aligning it with platform.sh
subhojit777 099c0d5
debug: see if now the name appears
subhojit777 cb8ee2c
hat: see if this works
subhojit777 08e15d1
hat: mention that it is github env
subhojit777 d66e4d6
hat: simply specify the env var
subhojit777 134196a
hat: try using step output
subhojit777 e23c211
pass shell option
subhojit777 ad07cd3
debug: see if it is indeed setting the step output
subhojit777 0f1d4c1
debug: if env vars are available
subhojit777 5d6e503
hat: see if this sets the output value
subhojit777 379fc49
hat: see if this resolves the issue
subhojit777 8319c82
hat: see if this resolves unexpected symbol issue
subhojit777 dae7c77
hat: see if this resolves the GH var
subhojit777 b234867
add empty check condition while setting the var
subhojit777 d9830c8
fix the way the var is assigned
subhojit777 9aabc98
debug: steps
subhojit777 7aaa5b3
refer the correct step name
subhojit777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -17,6 +17,9 @@ inputs: | |||||||||||||||||
force-push: | ||||||||||||||||||
description: 'Force push to Platform.sh' | ||||||||||||||||||
required: false | ||||||||||||||||||
environment-name: | ||||||||||||||||||
description: 'Name of the platform.sh instance' | ||||||||||||||||||
required: false | ||||||||||||||||||
runs: | ||||||||||||||||||
using: "composite" | ||||||||||||||||||
steps: | ||||||||||||||||||
|
@@ -29,13 +32,22 @@ runs: | |||||||||||||||||
- uses: adam7/[email protected] | ||||||||||||||||||
with: | ||||||||||||||||||
token: ${{ inputs.cli-token }} | ||||||||||||||||||
- | ||||||||||||||||||
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" | ||||||||||||||||||
Comment on lines
+35
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
- 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
branding: | ||||||||||||||||||
icon: upload-cloud | ||||||||||||||||||
color: orange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
if [[ -n "$FORCE_PUSH" ]]; then | ||||||||
PLATFORM_OPTS="$PLATFORM_OPTS --force" | ||||||||
fi | ||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.