Skip to content

Commit

Permalink
Upload pr_deploy workflow files for production, staging and development.
Browse files Browse the repository at this point in the history
  • Loading branch information
ekedonald committed Aug 8, 2024
1 parent 5917339 commit eb4fd90
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/development_pr_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PR Deploy
on:
pull_request:
types: [opened, synchronize, reopened, closed]
workflow_dispatch:

jobs:
deploy-pr:
environment:
name: development
# url: ${{ steps.deploy.outputs.preview-url }}
runs-on: ubuntu-latest
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}

steps:
- name: Checkout to branch
uses: actions/checkout@v4
- id: deploy
name: Pull Request Deploy
uses: hngprojects/pr-deploy@dev
with:
server_host: ${{ env.SSH_HOST }}
server_username: ${{ env.SSH_USERNAME }}
server_password: ${{ secrets.SERVER_PASSWORD }}
server_port: ${{ env.SSH_PORT }}
comment: true
context: '.'
dockerfile: 'Dockerfile'
exposed_port: '8019'
# host_volume_path: '/var/'
# container_volume_path: '/var/'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Preview Url
run: |
echo "Preview Url: ${{ steps.deploy.outputs.preview-url }}"
39 changes: 39 additions & 0 deletions .github/workflows/production_pr_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PR Deploy
on:
pull_request:
types: [opened, synchronize, reopened, closed]
workflow_dispatch:

jobs:
deploy-pr:
environment:
name: production
# url: ${{ steps.deploy.outputs.preview-url }}
runs-on: ubuntu-latest
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}

steps:
- name: Checkout to branch
uses: actions/checkout@v4
- id: deploy
name: Pull Request Deploy
uses: hngprojects/pr-deploy@main
with:
server_host: ${{ env.SSH_HOST }}
server_username: ${{ env.SSH_USERNAME }}
server_password: ${{ secrets.SERVER_PASSWORD }}
server_port: ${{ env.SSH_PORT }}
comment: true
context: '.'
dockerfile: 'Dockerfile'
exposed_port: '8019'
# host_volume_path: '/var/'
# container_volume_path: '/var/'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Preview Url
run: |
echo "Preview Url: ${{ steps.deploy.outputs.preview-url }}"
39 changes: 39 additions & 0 deletions .github/workflows/staging_pr_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PR Deploy
on:
pull_request:
types: [opened, synchronize, reopened, closed]
workflow_dispatch:

jobs:
deploy-pr:
environment:
name: staging
# url: ${{ steps.deploy.outputs.preview-url }}
runs-on: ubuntu-latest
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}

steps:
- name: Checkout to branch
uses: actions/checkout@v4
- id: deploy
name: Pull Request Deploy
uses: hngprojects/pr-deploy@staging
with:
server_host: ${{ env.SSH_HOST }}
server_username: ${{ env.SSH_USERNAME }}
server_password: ${{ secrets.SERVER_PASSWORD }}
server_port: ${{ env.SSH_PORT }}
comment: true
context: '.'
dockerfile: 'Dockerfile'
exposed_port: '8019'
# host_volume_path: '/var/'
# container_volume_path: '/var/'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Preview Url
run: |
echo "Preview Url: ${{ steps.deploy.outputs.preview-url }}"

0 comments on commit eb4fd90

Please sign in to comment.