-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/hngprojects/hng_boilerplate_…
…nextjs into fix/fixed-side-navbar-and-scrollable-content
- Loading branch information
Showing
28 changed files
with
1,156 additions
and
808 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Pheonix Deployment | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build and Upload"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: "panther-expressjs" | ||
url: ${{ vars.URL }} | ||
|
||
steps: | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
name: boilerplate-build | ||
path: . | ||
|
||
- name: Decode ENV secret | ||
run: | | ||
echo "${{ secrets.ENV }}" > encoded_env.txt | ||
base64 -d encoded_env.txt > .env.expressjs | ||
- name: Copy Artifacts to server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
source: ".env.expressjs,boilerplate.tar.gz" | ||
target: "/tmp/expressjs" | ||
|
||
- name: Deploy on server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
password: ${{ secrets.PASSWORD }} | ||
script: | | ||
cd hng_boilerplate_nextjs | ||
tar -xzf /tmp/expressjs/boilerplate.tar.gz | ||
mv /tmp/expressjs/.env.expressjs .env | ||
rm -f /tmp/expressjs/boilerplate.tar.gz | ||
cp -r .next/standalone/* . | ||
pm2 restart nextjs_boilerplate --update-env |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.