Skip to content

Commit

Permalink
ci: fixed build issues with ci
Browse files Browse the repository at this point in the history
GitHub Actions failed due to new build workflow requiring config.json file during build and not just
during synth
  • Loading branch information
flamingquaks committed Oct 28, 2024
1 parent aa13981 commit ba4dd53
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 255 deletions.
5 changes: 0 additions & 5 deletions .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .github/pull_request_template.md

This file was deleted.

91 changes: 26 additions & 65 deletions .github/workflows/build-on-every-push.yml
Original file line number Diff line number Diff line change
@@ -1,76 +1,37 @@
# This workflow is designed to build and synthesize each push to reduce risk of failing builds moving into main
name: Build and Synthesize


on:
push:
branches:
- '**'
workflow_dispatch:
workflow_dispatch:
jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Upload UI Artifact
uses: actions/upload-artifact@v4
with:
name: built-ui
path: lib/user-interface/genai-newsletter-ui/dist/
- name: Upload AppSync Resolver Artifacts
uses: actions/upload-artifact@v4
with:
name: built-resolver-functions
path: lib/api/functions/out

synthesis:
needs: build
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm ci

- name: Download UI Artifact
uses: actions/download-artifact@v4
with:
name: built-ui
path: lib/user-interface/genai-newsletter-ui/dist/
merge-multiple: true

- name: Download Resolver Function Artifacts
uses: actions/download-artifact@v4
with:
name: built-resolver-functions
path: lib/api/functions/out/
merge-multiple: true

- name: Generate Configuration file
run: echo "${DEPLOY_CONFIG}" > ./bin/config.json
env:
DEPLOY_CONFIG: ${{ vars.DEPLOY_CONFIG }}

- name: Synthesize CDK
run: npx cdk synth

- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Generate Configuration file
run: echo "${DEPLOY_CONFIG}" > ./bin/config.json
env:
DEPLOY_CONFIG: ${{ vars.DEPLOY_CONFIG }}

- name: Build project
run: npm run build

- name: Upload UI Artifact
uses: actions/upload-artifact@v4
with:
name: built-ui
path: lib/user-interface/genai-newsletter-ui/dist/
- name: Upload AppSync Resolver Artifacts
uses: actions/upload-artifact@v4
with:
name: built-resolver-functions
path: lib/api/functions/out
75 changes: 0 additions & 75 deletions .github/workflows/build.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/pull-request-lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# ~~ Generated by projen. To modify, edit .projenrc.ts and run "npx projen".

name: pull-request-lint
on:
pull_request_target:
Expand All @@ -17,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target')
steps:
- uses: amannn/[email protected]
env:
Expand All @@ -28,3 +26,5 @@ jobs:
fix
chore
requireScope: false


84 changes: 0 additions & 84 deletions .github/workflows/upgrade.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions .npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions .projen/files.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const project = new awscdk.AwsCdkTypeScriptApp({
'lib/**/*.js',
'lib/api/functions/out/',
],
github: false,
pullRequestTemplate: true,
appEntrypoint: 'bin/genai-newsletter-app.ts',
bin: {
'genai-newsletter-app': 'bin/genai-newsletter-app.ts',
Expand Down
Loading

0 comments on commit ba4dd53

Please sign in to comment.