feat: annual update #1413
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
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen". | |
name: deploy | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.12.0 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-west-1 | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
role-session-name: github-actions-session | |
- name: Install Dependencies | |
run: yarn --frozen-lockfile | |
- name: Set CDK Application Stage | |
id: stage | |
run: |- | |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
echo ::set-output name=stage::"prod" | |
else | |
echo ::set-output name=stage::"pr-${{ github.event.number }}" | |
fi | |
- name: Create GitHub Deployment | |
id: deployment | |
uses: bobheadxi/deployments@v1 | |
with: | |
step: start | |
token: ${{ secrets.GITHUB_TOKEN }} | |
env: ${{ steps.stage.outputs.stage }} | |
ref: ${{ github.head_ref }} | |
- name: Diff? | |
run: npx cdk diff --context stage=${{ steps.stage.outputs.stage }} | |
- name: Deploy! | |
id: deploy | |
run: |- | |
npx projen deploy \ | |
--require-approval never \ | |
--outputs-file outputs.json \ | |
--context stage=${{ steps.stage.outputs.stage }} && | |
echo ::set-output name=env_url::"http://$(jq -r '.[] | select(.serviceloadbalancerdnsoutput).serviceloadbalancerdnsoutput' outputs.json)" | |
- name: Update GitHub Deployment Status | |
if: always() | |
uses: bobheadxi/deployments@v1 | |
with: | |
step: finish | |
token: ${{ secrets.GITHUB_TOKEN }} | |
status: ${{ job.status }} | |
env: ${{ steps.stage.outputs.stage }} | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
env_url: ${{ steps.deploy.outputs.env_url }} |