From 59d94689d8583d51d9ec6cb81df01a1b1e551d39 Mon Sep 17 00:00:00 2001 From: Adrien Carpentier Date: Wed, 28 Aug 2024 01:31:35 +0200 Subject: [PATCH] ci: auto bump version from tag in package.json --- .github/workflows/deploy_prod.yml | 15 ++++++++++++++- .github/workflows/deploy_staging.yml | 8 +++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml index 1ffa1ec..ff62d79 100644 --- a/.github/workflows/deploy_prod.yml +++ b/.github/workflows/deploy_prod.yml @@ -6,11 +6,24 @@ on: - "*" jobs: + deploy-prod: + name: Deploy to prod from ${{ github.ref_name }}/${{ github.sha }} + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 + + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Bump version in package.json + uses: ramonpaolo/bump-version@v2.3.1 + with: + tag: ${{ github.ref_name }} # Accessing the context and get the reference_name, that in this case, is the created tag (ex: 1.0.0) + commit: true + branch_to_push: 'main' - uses: oven-sh/setup-bun@v1 name: Install Bun diff --git a/.github/workflows/deploy_staging.yml b/.github/workflows/deploy_staging.yml index 6e0720f..16ec111 100644 --- a/.github/workflows/deploy_staging.yml +++ b/.github/workflows/deploy_staging.yml @@ -6,11 +6,17 @@ on: - main jobs: + deploy-staging: + name: Deploy to staging from ${{ github.ref_name }}/${{ github.sha }} + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 + + - name: Checkout repo + uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 name: Install Bun