ci: adapt for pull_request hook
All checks were successful
Deploy workflow / deploy (push) Successful in 31s
All checks were successful
Deploy workflow / deploy (push) Successful in 31s
This commit is contained in:
parent
94b1d82047
commit
b622a9b57d
1 changed files with 20 additions and 10 deletions
|
@ -8,6 +8,8 @@ on:
|
|||
branches:
|
||||
- master
|
||||
- develop
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
@ -15,21 +17,24 @@ jobs:
|
|||
container:
|
||||
image: code.forgejo.org/oci/node:20-bookworm
|
||||
steps:
|
||||
- name: Install rsync and bash
|
||||
run: apt update && apt install -y rsync bash
|
||||
- name: Set baseURL
|
||||
shell: /bin/bash
|
||||
run: |
|
||||
if [[ "${{ env.github_ref_name }}" == "master" ]]; then
|
||||
echo "Checking current branch."
|
||||
echo -n "https://dev.etoiledebethleem.fr" > /base_url.txt
|
||||
if [ "${{ env.github_ref_name }}" = "master" ]
|
||||
then
|
||||
echo "Using master config"
|
||||
echo -n "https://etoiledebethleem.fr" > /base_url.txt
|
||||
fi
|
||||
if [[ "${{ env.github_ref_name }}" == "develop" ]]; then
|
||||
if [ "${{ env.github_ref_name }}" = "develop" ]
|
||||
then
|
||||
echo "Using develop config"
|
||||
echo -n "https://preview.etoiledebethleem.fr" > /base_url.txt
|
||||
fi
|
||||
ls /
|
||||
ls -la /base_url.txt
|
||||
cat /base_url.txt
|
||||
- name: Install rsync
|
||||
run: apt update && apt install -y rsync
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
@ -57,8 +62,13 @@ jobs:
|
|||
REMOTE_USER: forgejo_actions_websites
|
||||
SRV_HOST: srv06.lefuturiste.fr
|
||||
run: |
|
||||
if [ "${{ env.github_ref_name }}" = "master" ] || [ "${{ env.github_ref_name }}" = "develop" ]
|
||||
then
|
||||
echo "Deploying to $REMOTE_USER@$SRV_HOST:$OUTPUT_PATH$GITHUB_REF_NAME"
|
||||
rsync --perms --archive --stats \
|
||||
-e 'ssh -i ~/.ssh/id_edsa -o StrictHostKeyChecking=no' ./public \
|
||||
$REMOTE_USER@$SRV_HOST:$OUTPUT_PATH$GITHUB_REF_NAME
|
||||
|
||||
else
|
||||
echo "Deployment skipped."
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue