Skip to content

Instantly share code, notes, and snippets.

@luandevpro
Last active August 15, 2020 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luandevpro/7ca6ee3d75100c111da17f8420eaac53 to your computer and use it in GitHub Desktop.
Save luandevpro/7ca6ee3d75100c111da17f8420eaac53 to your computer and use it in GitHub Desktop.
name: Deploy application
on:
push:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy NodeJS app
uses: appleboy/ssh-action@v0.1.2
with:
host: ${{secrets.SSH_HOST}}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
mkdir -p ~/my-express-app/
cd ~/my-express-app/
git clone https://github.com/Hakalon/nodejs-pm2-example
cd nodejs-pm2-example
npm install
npm run start
jobs: is the base component of a workflow run
build: is the identifier we're attaching to this job
name: is the name of the job, this is displayed on GitHub when the workflow is running
steps: the linear sequence of operations that make up a job
uses: actions/checkout@v1 uses a community action called checkout to allow the workflow to access the contents of the repository
uses: ./action-a provides the relative path the action we've created in the action-a directory of the repository
with: is used to specify the input variables that will be available to your action in the runtime environment. In this case, the input variable is MY_NAME, and it is currently initialized to "Mona".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment