-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
name: Deploy | ||
on: | ||
push: | ||
branches: master | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install SSH Keys | ||
run: | | ||
install -m 600 -D /dev/null ~/.ssh/id_rsa | ||
echo "${{ secrets.AVERLIST_KEY }}" > ~/.ssh/id_rsa | ||
ssh-keyscan -H ${{ secrets.AVERLIST_HOST }} > ~/.ssh/known_hosts | ||
- name: Clone Project | ||
uses: actions/checkout@v3 | ||
- name: Install Deps | ||
run: npm install -prefix client | ||
- name: Get .env For Client | ||
run: scp -r ${{ secrets.AVERLIST_USER }}@${{ secrets.AVERLIST_HOST }}:/home/backup/client/.env.local client | ||
- name: Build Client | ||
run: npm run build --prefix client | ||
- name: Connect And Pull | ||
run: ssh ${{ secrets.AVERLIST_USER }}@${{ secrets.AVERLIST_HOST }} "sh /root/deploy-averlist.sh" | ||
- name: Clone Build To Server | ||
run: scp -r client/.next ${{ secrets.AVERLIST_USER }}@${{ secrets.AVERLIST_HOST }}:/home/averlist/client | ||
- name: Start pm2 | ||
run: ssh ${{ secrets.AVERLIST_USER }}@${{ secrets.AVERLIST_HOST }} "sh /root/post-deploy-averlist.sh" | ||
- name: Cleanup | ||
run: rm -rf ~/.ssh | ||
name: Deploy | ||
on: | ||
push: | ||
branches: master | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install SSH Keys | ||
run: | | ||
install -m 600 -D /dev/null ~/.ssh/id_rsa | ||
echo "${{ secrets.AVERLIST_KEY }}" > ~/.ssh/id_rsa | ||
ssh-keyscan -H ${{ secrets.AVERLIST_HOST }} > ~/.ssh/known_hosts | ||
- name: Clone Project | ||
uses: actions/checkout@v3 | ||
- name: Install Deps | ||
run: npm install -prefix client | ||
- name: Get .env For Client | ||
run: scp -r ${{ secrets.AVERLIST_USER }}@${{ secrets.AVERLIST_HOST }}:/home/backup/client/.env.local client | ||
- name: Build Client | ||
run: npm run build --prefix client | ||
- name: Connect And Pull | ||
run: ssh ${{ secrets.AVERLIST_USER }}@${{ secrets.AVERLIST_HOST }} "sh /root/deploy-averlist.sh" | ||
- name: Clone Build To Server | ||
run: scp -r client/.next ${{ secrets.AVERLIST_USER }}@${{ secrets.AVERLIST_HOST }}:/home/averlist/client | ||
- name: Clone node_modules To Server | ||
run: scp -r client/node_modules ${{ secrets.AVERLIST_USER }}@${{ secrets.AVERLIST_HOST }}:/home/averlist/client | ||
- name: Start pm2 | ||
run: ssh ${{ secrets.AVERLIST_USER }}@${{ secrets.AVERLIST_HOST }} "sh /root/post-deploy-averlist.sh" | ||
- name: Cleanup | ||
run: rm -rf ~/.ssh |