feat: add Gitea Actions workflow for Next.js SSH deployment.
Deploy Next.js via SSH / deploy (push) Successful in 8s
Details
Deploy Next.js via SSH / deploy (push) Successful in 8s
Details
This commit is contained in:
parent
e761c58aed
commit
51e115b45a
|
|
@ -7,28 +7,27 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Blue-Green Deploy
|
||||
- name: Blue-Green
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: 10.1.1.124
|
||||
username: juru
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
script: |
|
||||
set -e # Interrompe o script se qualquer comando der erro
|
||||
|
||||
RELEASE_NAME=release-$(date +%Y%m%d%H%M%S)
|
||||
RELEASE_PATH=/home/juru/apps/releases/$RELEASE_NAME
|
||||
|
||||
git clone http://10.1.1.124:3000/joelson/Portal-dias-rota.git $RELEASE_PATH
|
||||
|
||||
cd $RELEASE_PATH
|
||||
|
||||
cp /home/juru/apps/.env .env
|
||||
|
||||
npm install --legacy-peer-deps
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
cp -r public .next/standalone/
|
||||
cp -r .next/static .next/standalone/.next/
|
||||
cp .env .next/standalone/.env
|
||||
|
||||
ln -sfn $RELEASE_PATH /home/juru/apps/current
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue