Skip to content

Commit

Permalink
👷 ci(deploy): Split production and preprod environment
Browse files Browse the repository at this point in the history
  • Loading branch information
vvatelot committed Dec 30, 2022
1 parent 72d1148 commit 6026ed5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy-preproduction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Déploiement RSYNC en preproduction

on:
push:
tags:
- "v*.*.*-preproduction"

jobs:
deploy:
environment: preproduction
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout
uses: actions/checkout@v3
- name: ✨ Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "latest"
- name: ✨ Setup NPM
uses: bahmutov/npm-install@v1
- name: 🛠️ Build
run: hugo
- name: 🔑 Install SSH Key
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
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 }}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Deploy rsync
name: Déploiement RSYNC en production

on:
push:
tags:
- "v*.*.*"
- "v*.*.*-production"

jobs:
deploy:
environment: production
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout
Expand Down

0 comments on commit 6026ed5

Please sign in to comment.