Skip to content

Project Deployment

Project Deployment #5

name: Project Deployment
on:
workflow_dispatch:
inputs:
project:
type: string
required: true
description: 'Project Name'
env:
NODE_VERSION: "18"
AWS_REGION: eu-central-1
AWS_DEFAULT_REGION: eu-central-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DOCKER_BUILDKIT: 1
ENVIRONMENT_ID: ${{ github.event.inputs.project }}
REPO_NAME: ${{ vars.REPO_NAME }}
REPO_OWNER: ${{ vars.REPO_OWNER }}
REPO_PATH: ${{ vars.REPO_PATH }}
COMMITTER_EMAIL: ${{ vars.COMMITTER_EMAIL }}
COMMITTER_NAME: ${{ vars.COMMITTER_NAME }}
AUTHOR_EMAIL: ${{ vars.AUTHOR_EMAIL }}
AUTHOR_NAME: ${{ vars.AUTHOR_NAME }}
TARGET_BRANCH: ${{ vars.TARGET_BRANCH }}
CONFLICT_RETRIES: ${{ vars.CONFLICT_RETRIES }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup node environment
uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
cache: npm
registry-url: https://npm.pkg.github.com/
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Configure Github registry
run: |
npm config set @deven-org:registry=https://npm.pkg.github.com/
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.TOKEN_GITHUB }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Deploy
run: |
npx aws-cdk synth
npx aws-cdk deploy --all --require-approval=never