Skip to content

Commit

Permalink
ci(deploy): Split production and preprod environment (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvatelot authored Nov 24, 2023
1 parent 6764f1b commit 6f25189
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
name: Deploy rsync
name: RSYNC Deploy

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

jobs:
env:
name: Get deploy environment based on tag suffix
runs-on: ubuntu-latest
outputs:
target-env: ${{ steps.get_environment.outputs.target-env }}
steps:
- name: 🛒 Checkout
uses: actions/checkout@v3
- 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
fi
deploy:
needs: env
environment:
name: ${{ needs.env.outputs.target-env }}
runs-on: ubuntu-latest
environment: production
steps:
- name: 🛒 Checkout
uses: actions/checkout@v3
Expand Down

0 comments on commit 6f25189

Please sign in to comment.