Skip to content

Commit

Permalink
Merge pull request #53 from hngprojects/main-hotfix
Browse files Browse the repository at this point in the history
Update pr-deploy.sh: fix directory creation and readme pr-deploy version
  • Loading branch information
osadeleke authored Aug 1, 2024
2 parents 6f58a29 + 72faf06 commit b4ef08b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This GitHub Action deploys pull requests in Docker containers, allowing you to t
Pull request events trigger this action. It builds the Docker image for the pull request and deploys it in a new Docker container. This step calls the action tool in the workflow script
```
steps:
- uses: hngprojects/[email protected].6
- uses: hngprojects/[email protected].7
```
## Inputs
The following inputs are required to configure the GitHub Action. These inputs allow the action to connect to your server, specify the:
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Deploy PR
uses: hngprojects/[email protected].6
uses: hngprojects/[email protected].7
with:
server_host: ${{ secrets.SERVER_HOST }}
server_username: ${{ secrets.SERVER_USERNAME }}
Expand Down
7 changes: 5 additions & 2 deletions pr-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function kill_process_with_pid() {
fi
}

# Setup directory
mkdir -p ${DEPLOY_FOLDER}/

# Initialize the JSON file for nohup if it doesn't exist
if [ ! -f "$PID_FILE" ]; then
echo "{}" > "$PID_FILE"
Expand Down Expand Up @@ -61,8 +64,8 @@ fi
# Free port
FREE_PORT=$(python3 -c 'import socket; s = socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()')

# Setup directory
mkdir -p ${DEPLOY_FOLDER}/
# # Setup directory
# mkdir -p ${DEPLOY_FOLDER}/
cd ${DEPLOY_FOLDER}
rm -rf $PR_ID

Expand Down

0 comments on commit b4ef08b

Please sign in to comment.