Skip to content

Instantly share code, notes, and snippets.

@atakde
Created August 21, 2022 15:51
Show Gist options
  • Save atakde/1f38ced82ebe0af048fbeeee8c4ce2bc to your computer and use it in GitHub Desktop.
Save atakde/1f38ced82ebe0af048fbeeee8c4ce2bc to your computer and use it in GitHub Desktop.
Deploy in Digital Ocean With Github Actions
# This is a basic workflow to help you get started with Actions
name: Build And Deploy
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy app
uses: appleboy/[email protected]
with:
host: ${{ secrets.DO_HOST }}
username: ${{ secrets.DO_USERNAME }}
password: ${{ secrets.DO_PASSWORD }}
script: |
cd /var/www/html/
git pull
yarn build
echo "Deployment successful!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment