I am trying to build my react app on github actions then deploy it to digital oceans app platform. It keeps building but doesn’t seem to actually be making changes, here is my actions script. I’m also not even sure this is possible
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
CI: false
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Deploy to DigitalOcean App Platform
run: doctl apps create-deployment ${{ secrets.PROD_APP_ID }}
2
Answers
Try changing the DigitalOcean run command to
doctl apps update PROD_APP_ID --spec .do/app.yaml
Make sure you have the .yaml file in your repository, that specifies the configuration for your DO deployment.
Code:
And here’s and example for the app.yaml file:
I think you can use ssh-deploy to deploy your react app on Digital ocean. I provide sample code I used in my react web application.