saahildcom/.github/workflows/deploy.yml

42 lines
1.2 KiB
YAML
Raw Normal View History

2024-09-06 16:36:27 +00:00
name: Remote Deploy
on:
push:
branches:
- main
paths:
# on code related change
- ".github/workflows/deploy.yml"
- "src/**"
- "public/**"
workflow_dispatch:
2024-06-25 05:12:52 +00:00
jobs:
build:
name: Build & deploy
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set Short SHA
id: short_sha
run: |
echo $(pwd)
echo $(ls)
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@v0.1.8
with:
context: .
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
2024-06-25 05:12:52 +00:00
cd /${{ secrets.USERNAME }}
2024-08-08 04:23:15 +00:00
export REACT_APP_BUILD_SHA=${{ steps.short_sha.outputs.short_sha }}
export REACT_APP_BUILD_ID=${{ github.run_id }}
export REACT_APP_BUILD_NUM=${{ github.run_number }}
2024-09-06 16:36:27 +00:00
bash ./deploy.sh ${{ github.event.repository.name }}