Skip to content

v4.22.25

v4.22.25 #176

Workflow file for this run

name: Deploy release
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
required: true
type: string
default: v4.8.7
description: Release version
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
issues: write
contents: write
env:
HUSKY: 0
RELEASE_VERSION: ${{ github.event.inputs.version || github.ref_name }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
jobs:
deploy:
timeout-minutes: 45
runs-on: ubuntu-latest
environment: aws-cdk
steps:
- run: echo "Release process starting for version ${{ env.RELEASE_VERSION }}"
- uses: actions/checkout@v4
name: 'Checkout version tagged branch'
with:
ref: ${{ env.RELEASE_VERSION }}
fetch-depth: 0
fetch-tags: true
- name: Install Deps
uses: ./.github/actions/install-deps
- name: Find previous deployment tag
id: previous_deployment
run: |
echo "Determining SHAs for affected projects"
PREVIOUS_DEPLOYMENT=$(git describe --tags --abbrev=0 --match="*deployed")
echo "Previous release: $PREVIOUS_DEPLOYMENT"
echo "NX_BASE=$PREVIOUS_DEPLOYMENT" >> $GITHUB_ENV
echo "NX_HEAD=$RELEASE_VERSION" >> $GITHUB_ENV
- name: Show affected projects
run: echo "Affected projects = $(npx nx show projects --affected -t deploy)"
- name: Deploy CDK Apps
run: |
npx nx affected --target=deploy -- --all --require-approval=never
- name: Tag deployment success
run: |
git config --global user.email "github-actions[bot]@users.no-reply.github.com"
git config --global user.name "github-actions[bot]"
DEPLOY_TAG=$RELEASE_VERSION
git tag -a "$DEPLOY_TAG-deployed" $GITHUB_SHA -m "Version $RELEASE_VERSION deployed successfully"
git push origin --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Issue
if: failure()
run: |
gh issue create \
--title "bug(deploy): Deploy release ${{ env.RELEASE_VERSION }} failed" \
--body "GitHub [Deploy release workflow](${{ github.event.html_url }})" \
--label "bug" \
--assignee "${{ github.actor }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}