I am trying to deploy a branch when a pull request is made to deploy the app to a Digital Ocean app platform container. I have based the workflow on the example code that Digital Ocean provided for this.
However creating a pull request is not triggering the action. I added a manual trigger but that is failing as it is expecting a pull request ID.
Can anyone help me diagnose the issue?
name: App Platform Preview
on:
pull_request:
branches: [ghactions]
types: [opened, synchronize, reopened, closed]
workflow_dispatch:
inputs:
pr_number:
description: 'Pull Request Number'
required: true
type: number
permissions:
contents: read
pull-requests: write
jobs:
deploy-admin:
name: Deploy Admin
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Deploy the admin app
id: deploy-admin
uses: digitalocean/app_action/deploy@v2
with:
deploy_pr_preview: "true"
token: ${{ secrets.DO_DEPLOY_EXPIRES_2025_12_17 }}
app_spec_location: .do/admin/app.yaml
- uses: actions/github-script@v7
env:
BUILD_LOGS: ${{ steps.deploy-admin.outputs.build_logs }}
DEPLOY_LOGS: ${{ steps.deploy-admin.outputs.deploy_logs }}
with:
script: |
const { BUILD_LOGS, DEPLOY_LOGS } = process.env;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🚀 The **admin app** was successfully deployed at ${{ fromJson(steps.deploy-admin.outputs.app).live_url }}.`
});
- uses: actions/github-script@v7
if: failure()
with:
script: |
const { BUILD_LOGS, DEPLOY_LOGS } = process.env;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `The **admin app** failed to be deployed. Logs can be found [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
## Logs
<details>
<summary>Build logs</summary>
```
${BUILD_LOGS}
```
</details>
<details>
<summary>Deploy logs</summary>
```
${DEPLOY_LOGS}
```
</details>`
});
5