Skip to content

Commit

Permalink
Merge branch 'master' into translate-to-english
Browse files Browse the repository at this point in the history
  • Loading branch information
vvatelot committed Nov 24, 2023
2 parents 4cf5619 + 881636b commit 533e08b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RSYNC_REMOTE_PORT=2222
RSYNC_REMOTE_USER=vvatelot
RSYNC_REMOTE_HOST=ecoindex.lebondeveloppeur.fr
RSYNC_REMOTE_FOLDER=/home/vvatelot/ecoindex_site
14 changes: 9 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: RSYNC Deploy

on:
push:
branches:
- main
tags:
- "v*.*.*"

Expand All @@ -17,10 +19,10 @@ jobs:
- name: 🚀 Get Environment
id: get_environment
run: |
if [[ ${{ github.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+$ ]]; then
echo "target-env: preproduction" > $GITHUB_OUTPUT
elif [[ ${{ github.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "target-env: production" > $GITHUB_OUTPUT
if [[ ${{ github.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "target-env=production" > $GITHUB_OUTPUT
else
echo "target-env=preproduction" > $GITHUB_OUTPUT
fi
deploy:
Expand All @@ -45,4 +47,6 @@ jobs:
echo "${{ secrets.RSYNC_PRIVATE_SSH_KEY }}" > ~/.ssh/id_rsa
echo "${{ secrets.RSYNC_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
- name: 🚀 Deploy
run: rsync -rpzv --exclude="screenshots" -e 'ssh -p ${{ secrets.RSYNC_REMOTE_PORT }}' './public/' ${{ secrets.RSYNC_REMOTE_USER }}@${{ secrets.RSYNC_REMOTE_HOST }}:${{ secrets.RSYNC_REMOTE_FOLDER }}
run: |
echo "Deploying to ${{ needs.env.outputs.target-env }}" >> $GITHUB_STEP_SUMMARY
rsync -rpzv --exclude="screenshots" -e 'ssh -p ${{ secrets.RSYNC_REMOTE_PORT }}' './public/' ${{ secrets.RSYNC_REMOTE_USER }}@${{ secrets.RSYNC_REMOTE_HOST }}:${{ secrets.RSYNC_REMOTE_FOLDER }}

0 comments on commit 533e08b

Please sign in to comment.