-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* workflow corrections * Updated job permissions
- Loading branch information
1 parent
a72098d
commit 8025167
Showing
9 changed files
with
198 additions
and
63 deletions.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: 'Update GitHub Deployment Status' | ||
description: 'Creates and updates GitHub deployment status' | ||
|
||
inputs: | ||
environment: | ||
description: 'The deployment environment (e.g., Staging, Production)' | ||
required: true | ||
deployment-url: | ||
description: 'The URL of the deployment' | ||
required: true | ||
sha: | ||
description: 'The commit SHA' | ||
required: true | ||
status: | ||
description: 'The deployment status (pending, success, failure)' | ||
required: true | ||
description: | ||
description: 'Description of the deployment status' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Update GitHub deployment status | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const deployment = await github.rest.repos.createDeployment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: '${{ inputs.sha }}', | ||
environment: '${{ inputs.environment }}', | ||
auto_merge: false, | ||
required_contexts: [], | ||
description: '${{ inputs.description }}' | ||
}); | ||
await github.rest.repos.createDeploymentStatus({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
deployment_id: deployment.data.id, | ||
state: '${{ inputs.status }}', | ||
environment_url: '${{ inputs.deployment-url }}', | ||
description: '${{ inputs.description }}' | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 'Generate App ID' | ||
description: 'Generates a random app ID for preview deployments' | ||
|
||
outputs: | ||
app-id: | ||
description: 'The generated app ID' | ||
value: ${{ steps.generate.outputs.app-id }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Generate random ID | ||
id: generate | ||
shell: bash | ||
run: | | ||
APP_ID=$(openssl rand -hex 8) | ||
echo "app-id=$APP_ID" >> $GITHUB_OUTPUT |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: 'Prepare Preview URL' | ||
description: 'Prepares preview URL with app ID for preview environments' | ||
|
||
inputs: | ||
deployment-url: | ||
description: 'Base deployment URL' | ||
required: true | ||
app-id: | ||
description: 'App ID to append as query parameter' | ||
required: true | ||
|
||
outputs: | ||
url: | ||
description: 'The final preview URL with app ID' | ||
value: ${{ steps.prepare.outputs.url }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Prepare URL | ||
id: prepare | ||
shell: bash | ||
run: | | ||
FINAL_URL="${{ inputs.deployment-url }}?app-id=${{ inputs.app-id }}" | ||
echo "url=$FINAL_URL" >> $GITHUB_OUTPUT |
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
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
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