Skip to content

Commit

Permalink
added csharp-boilerplater workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
augusthottie committed Aug 15, 2024
1 parent 760b2a1 commit de46390
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/kimiko-csharp-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Kimiko Csharp Deployment

on:
workflow_dispatch:
workflow_run:
workflows: ["Build and Upload"]
types:
- completed

jobs:
deploy_boilerplate_frontend:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

environment:
name: "kimiko-csharp"
url: ${{ vars.URL }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- 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: Create .env
uses: vicradon/[email protected]
with:
action_input_file: ".env.sample"
action_output_file: ".env"
API_URL: ${{ vars.API_URL }}
NEXTAUTH_URL: ${{ vars.URL }}

- name: Copy Artifacts to server
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: ".env,boilerplate.tar.gz"
target: "~/deployments/hng_boilerplate_nextjs"

- name: Deploy on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/deployments/hng_boilerplate_nextjs
tar -xzf boilerplate.tar.gz
rm -f boilerplate.tar.gz
pm2 restart boilerplate-frontend --update-env

0 comments on commit de46390

Please sign in to comment.