2024-06-25 05:12:52 +00:00
|
|
|
name: remote ssh command
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build & deploy
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
environment: production
|
|
|
|
steps:
|
2024-08-08 04:23:15 +00:00
|
|
|
- name: Set Short SHA
|
|
|
|
id: short_sha
|
2024-08-08 04:31:06 +00:00
|
|
|
run: |
|
|
|
|
echo $(pwd)
|
2024-08-08 04:32:03 +00:00
|
|
|
echo $(ls)
|
|
|
|
cd .git
|
2024-08-08 04:31:06 +00:00
|
|
|
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
2024-06-25 05:12:52 +00:00
|
|
|
- name: executing remote ssh commands using password
|
|
|
|
uses: appleboy/ssh-action@v0.1.8
|
|
|
|
with:
|
2024-08-08 04:29:00 +00:00
|
|
|
context: .
|
2024-06-25 05:12:52 +00:00
|
|
|
host: ${{ secrets.HOST }}
|
|
|
|
username: ${{ secrets.USERNAME }}
|
|
|
|
password: ${{ secrets.PASSWORD }}
|
|
|
|
port: ${{ secrets.PORT }}
|
|
|
|
script: |
|
|
|
|
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-06-25 05:12:52 +00:00
|
|
|
bash ./deploy.sh ${{ github.event.repository.name }}
|