✨ Changement des intitules concernant la puissance dans les condition… #117
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Release workflow' | |
concurrency: | |
group: release | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- release/* | |
jobs: | |
call-shared-workflow: | |
uses: ./.github/workflows/shared-workflow.yml | |
deploy-staging: | |
needs: call-shared-workflow | |
runs-on: ubuntu-latest | |
environment: staging | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Deploy to Staging | |
run: | | |
curl -O https://cli-dl.scalingo.com/install && bash install | |
scalingo login --api-token ${{ secrets.SCALINGO_TOKEN }} | |
scalingo --app ${{ secrets.SCALINGO_APP }} --region ${{ secrets.SCALINGO_REGION }} integration-link-manual-deploy ${{ github.ref_name }} | |
application-version: | |
runs-on: ubuntu-latest | |
needs: deploy-staging | |
outputs: | |
applicationVersion: ${{ steps.app_version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
- run: npm ci | |
- name: Set application version | |
id: app_version | |
run: | | |
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}} | |
BRANCH_VERSION=$(printf '%s\n' ${GIT_BRANCH//release\//}) | |
echo "BRANCH_VERSION=${BRANCH_VERSION}" | |
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`) | |
echo "TAG_VERSION=${TAG_VERSION}" | |
export BRANCH_VERSION="${BRANCH_VERSION}" && export TAG_VERSION="${TAG_VERSION}" && npm run version | |
PATCH_VERSION="$(cat .patch-version)" | |
APPLICATION_VERSION=${BRANCH_VERSION}.${PATCH_VERSION} | |
echo "version=${APPLICATION_VERSION}" >> $GITHUB_OUTPUT | |
deploy-production: | |
needs: application-version | |
runs-on: ubuntu-latest | |
environment: production | |
env: | |
APPLICATION_VERSION: ${{ needs.application-version.outputs.applicationVersion }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
- run: npm ci | |
- name: Push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
default_bump: false | |
default_prerelease_bump: false | |
custom_tag: ${{ env.APPLICATION_VERSION }} | |
tag_prefix: '' | |
- name: Deploy to Production | |
run: | | |
curl -O https://cli-dl.scalingo.com/install && bash install | |
scalingo login --api-token ${{ secrets.SCALINGO_TOKEN }} | |
scalingo --app ${{ secrets.SCALINGO_APP }} --region ${{ secrets.SCALINGO_REGION }} integration-link-manual-deploy ${{ github.ref_name }} | |
deploy-demo: | |
needs: deploy-production | |
runs-on: ubuntu-latest | |
environment: demo | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
cache: 'npm' | |
- run: npm ci | |
- name: Deploy to Demo | |
run: | | |
curl -O https://cli-dl.scalingo.com/install && bash install | |
scalingo login --api-token ${{ secrets.SCALINGO_TOKEN }} | |
scalingo --app ${{ secrets.SCALINGO_APP }} --region ${{ secrets.SCALINGO_REGION }} integration-link-manual-deploy ${{ github.ref_name }} |