Skip to content

Commit

Permalink
Merge pull request #986 from hngprojects/chore/create-bulldozer-deplo…
Browse files Browse the repository at this point in the history
…yment

Create bulldozer-php-deployment.yml
  • Loading branch information
Ravencodess authored Aug 15, 2024
2 parents 6699cc5 + c3880a7 commit d6ee65f
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/bulldozer-php-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Bulldozer PHP 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: "bulldozer-php"
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: "~/var/www/boilerplate_fe/dev"

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

0 comments on commit d6ee65f

Please sign in to comment.