GitHub Action
Platform.sh Actions
This action provides deployment features to Platform.sh and clears PR environments on PR merge.
deploy
: Deploys to Platform.sh.clean-pr-env
: Deactivates and deletes the environment on Platform.sh that was created when the PR was opened. This should only be used on theclosed
pull_request event.
The project ID on Platform.sh. You can find this using the CLI or the web console.
A token to access the Platform.sh API. See instructions in the Platform.sh docs.
The Platform.sh CLI generates a temporary certificate for deployment. However, you may still choose to provide a private key that lets you push via git. Create a specialized key used only for deployment and use GitHub secrets to keep your key safe.
The Platform.sh CLI version to use. Default: latest
.
An option to force push changes to the project repository on Platform.sh. Use with caution as force push overrides your commit history.
The name of the Platform.sh instance on which to act. Default: The current branch name.
The environment URL from platform.sh after successful deployment.
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy to platform.sh
uses: axelerant/platformsh-actions@v1
with:
action: 'deploy'
project-id: ${{ secrets.PlatformProjectId }}
cli-token: ${{ secrets.PlatformCliToken }}
ssh-private-key: ${{ secrets.PlatformSshKey }}
force-push: true
uses: axelerant/platformsh-actions@v1
with:
action: 'clean-pr-env'
project-id: ${{ secrets.PlatformProjectId }}
cli-token: ${{ secrets.PlatformCliToken }}