Skip to content

Commit

Permalink
amplify: add envvar
Browse files Browse the repository at this point in the history
Signed-off-by: AustinZhu <[email protected]>
  • Loading branch information
AustinZhu committed Nov 12, 2021
1 parent ec99288 commit 2281760
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEPLOY_KEY: ${{ secrets.FEEDS_DEPLOY_PRIVATE_KEY }}
FEEDS_DEPLOY_PRIVATE_KEY: ${{ secrets.FEEDS_DEPLOY_PRIVATE_KEY }}
STAGE: dev

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WasedaTime Backend

![AWS CDK CI/CD](https://github.com/wasedatime/wasedatime-backend/workflows/AWS%20CDK%20CI/CD/badge.svg)
[![AWS CDK CI/CD](https://github.com/wasedatime/wasedatime-backend/actions/workflows/deploy.yml/badge.svg)](https://github.com/wasedatime/wasedatime-backend/actions/workflows/deploy.yml)
![](https://img.shields.io/website?up_color=green&up_message=online&url=https%3A%2F%2Fwasedatime.com)

This repository defines the serverless application architecture, resource configuration and infrastructure provision strategy of
Expand Down
6 changes: 3 additions & 3 deletions lib/configs/amplify/build-setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {microAppCorsHeader, securityHeaders} from "./website";


export const bitToken = process.env.BIT_TOKEN!;
export const feedsDeployKey = process.env.FEEDS_DEPLOY_PRIVATE_KEY!;

const preBuild = {
commands: [
Expand All @@ -14,11 +15,10 @@ const preBuild = {
const preBuildForFeeds = {
commands: [
"eval $(ssh-agent -s)",
"ssh-add <(echo \"$DEPLOY_KEY\" | base64 --decode)",
"ssh-add <(echo \"$FEEDS_DEPLOY_PRIVATE_KEY\" | base64 --decode)",
"git submodule init",
"git submodule update --remote",
"yum check-update",
"yum -y install glibc gcc gcc-c++ autoconf automake libtool git make nasm pkgconfig",
"yum -y install make nasm autoconf automake libtool dpkg pkgconfig libpng libpng-dev g++",
"npm install -g pnpm",
"pnpm install --filter .",
],
Expand Down
3 changes: 2 additions & 1 deletion lib/constructs/presentation/web-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as cdk from "@aws-cdk/core";
import {App, Branch, CustomRule, Domain, RedirectStatus} from "@aws-cdk/aws-amplify";

import {developerAuth} from "../../configs/amplify/website";
import {bitToken, microAppBuildSpec, microAppDevBuildSpec} from "../../configs/amplify/build-setting";
import {bitToken, feedsDeployKey, microAppBuildSpec, microAppDevBuildSpec} from "../../configs/amplify/build-setting";
import {webAppCode} from "../../configs/amplify/codebase";
import {ROOT_DOMAIN} from "../../configs/route53/domain";

Expand Down Expand Up @@ -54,6 +54,7 @@ export class AmplifyMonoWebApp extends AbstractWebApp {
"REACT_APP_OAUTH_URL": `https://${props.authDomain}`,
"NODE_OPTIONS": "--max-old-space-size=8192",
"BIT_TOKEN": bitToken,
"FEEDS_DEPLOY_PRIVATE_KEY": feedsDeployKey,
},
sourceCodeProvider: webAppCode,
autoBranchCreation: {
Expand Down

0 comments on commit 2281760

Please sign in to comment.