Replace get previous tag with package version (#9968)

This commit is contained in:
Rory Powell 2023-03-09 16:33:48 +00:00 committed by GitHub
parent 05709cc0d4
commit acc193aa87
2 changed files with 29 additions and 15 deletions

View File

@ -1,6 +1,10 @@
name: "deploy-preprod" name: "deploy-preprod"
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
version:
description: Budibase release version. For example - 1.0.0
required: false
workflow_call: workflow_call:
jobs: jobs:
@ -8,9 +12,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: 'Get Previous tag'
id: previoustag - name: Get the latest budibase release version
uses: "WyriHaximus/github-action-get-previous-tag@v1" id: version
run: |
if [ -z "${{ github.event.inputs.version }}" ]; then
release_version=$(cat lerna.json | jq -r '.version')
else
release_version=${{ github.event.inputs.version }}
fi
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
- name: Configure AWS Credentials - name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1 uses: aws-actions/configure-aws-credentials@v1
@ -37,7 +48,7 @@ jobs:
helm: helm3 helm: helm3
values: | values: |
globals: globals:
appVersion: ${{ steps.previoustag.outputs.tag }} appVersion: ${{ env.RELEASE_VERSION }}
ingress: ingress:
enabled: true enabled: true
nginx: true nginx: true
@ -52,5 +63,5 @@ jobs:
uses: tsickert/discord-webhook@v4.0.0 uses: tsickert/discord-webhook@v4.0.0
with: with:
webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }}
content: "Preprod Deployment Complete: ${{ steps.previoustag.outputs.tag }} deployed to Budibase Pre-prod." content: "Preprod Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Budibase Pre-prod."
embed-title: ${{ steps.previoustag.outputs.tag }} embed-title: ${{ env.RELEASE_VERSION }}

View File

@ -91,9 +91,11 @@ jobs:
uses: azure/setup-helm@v1 uses: azure/setup-helm@v1
id: helm-install id: helm-install
- name: 'Get Previous tag' - name: Get the latest budibase release version
id: previoustag id: version
uses: "WyriHaximus/github-action-get-previous-tag@v1" run: |
release_version=$(cat lerna.json | jq -r '.version')
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
# due to helm repo index issue: https://github.com/helm/helm/issues/7363 # due to helm repo index issue: https://github.com/helm/helm/issues/7363
# we need to create new package in a different dir, merge the index and move the package back # we need to create new package in a different dir, merge the index and move the package back
@ -116,8 +118,6 @@ jobs:
git add -A git add -A
git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}" git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}"
git push git push
env:
RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }}
deploy-to-legacy-preprod-env: deploy-to-legacy-preprod-env:
needs: [release-images] needs: [release-images]
@ -130,13 +130,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: 'Get Previous tag'
id: previoustag - name: Get the latest budibase release version
uses: "WyriHaximus/github-action-get-previous-tag@v1" id: version
run: |
release_version=$(cat lerna.json | jq -r '.version')
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
- uses: passeidireto/trigger-external-workflow-action@main - uses: passeidireto/trigger-external-workflow-action@main
env: env:
PAYLOAD_VERSION: ${{ steps.previoustag.outputs.tag }} PAYLOAD_VERSION: ${{ env.RELEASE_VERSION }}
with: with:
repository: budibase/budibase-deploys repository: budibase/budibase-deploys
event: budicloud-preprod-deploy event: budicloud-preprod-deploy