Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nemeseri authored Mar 25, 2024
1 parent f29dfee commit 63a4257
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
name: Deploy

on: [push]
on:
push:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Copy repository contents via scp
uses: appleboy/scp-action@master
env:
HOST: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
with:
source: "."
target: "/www/family-site-reactjs"

- name: Executing remote command
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
script: npm install && npm build
- name: Deploy using ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
port: ${{ secrets.PORT }}
script: |
cd /www/family-site-reactjs
git pull origin main
npm install --only=prod
npm build

0 comments on commit 63a4257

Please sign in to comment.