Executes a stack command on a remote host.
Allows us to reuse this logic across all applications we deploy via Stack.
git-repo(required) GitHub repository to clone (e.g.my-org/my-repo-name)git-ref(required) Commit ref to check out (typically a hash)docker-image(required) Full URL to the Docker image to pull on deployed instancescommand(required) one ofdeployorplanproject(required) the project name as specified in thedeploy.ymlconfigurationrole(required) ARN of the role to assume in AWS (assumes you already have OIDC set up)ssh-user(optional) the user to connect to thessh-hostas (defaultec2-user)ssh-host(optional) the remote host to SSH intorelease-id(optional) name of the release (default timestamp + commit hash of the form2024-12-31T23-59-59-123Z-deadbeef)
Invoke in your workflow using:
jobs:
my-job:
steps:
- uses: warpcast/remote-exec
with:
git-repo: ${{ github.repository }}
git-ref: ${{ github.sha }}
docker-image: 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-organization/my-repository:${{ github.sha }} # ECR repo
command: deploy
project: 'my-project'
role: arn:aws:iam::123456789012:role/my-role-that-allows-oidc-authNotice that there's no need to clone the repo before invoking this action. Cloning occurs remotely on the host itself. This action assumes that only trusted code is being executed by the time it is run. Thus it is NOT recommended to use this action as part of a pull request, but rather as part of a release workflow that runs post-merge.