Upgrade to Pro — share decks privately, control downloads, hide ads and more …

コーポレートサイトを静的化してAmplify Consoleにデプロイする

cockscomb
November 27, 2020

コーポレートサイトを静的化してAmplify Consoleにデプロイする

AWS Amplify Meet-up #2で発表しました。

cockscomb

November 27, 2020
Tweet

More Decks by cockscomb

Other Decks in Programming

Transcript

  1. IR

  2. CI/CD amplify.yml YAML Amplify Console Amplify version: 1.0 backend: phases:

    preBuild: commands: - yarn build: commands: - amplifyPush - - simple frontend: phases: preBuild: commands: - yarn build: commands: - yarn workspace hatenacorp build - yarn workspace hatenacorp export artifacts: baseDirectory: ./packages/hatenacorp/out files: - '** / * ' cache: paths: - 'node_modules / * * / * '
  3. [ { "source": "/images", "target": "https: / / images.otherdomain.com", "status":

    "200", "condition": null }, { "source": "/ < * > ", "target": "/404.html", "status": "404-200", "condition": null } ]
  4. import * as cdk from '@aws-cdk/core' import * as amplify

    from '@aws-cdk/aws-amplify' export class AmplifyStack extends cdk.Stack { constructor(scope: cdk.Construct, id: string, props ? : cdk.StackProps) { super(scope, id, props) const amplifyApp = new amplify.App(this, 'hatenacorp', { sourceCodeProvider: new amplify.GitHubSourceCodeProvider({ owner: 'hatena', repository: 'hatenacorp', oauthToken: cdk.SecretValue.secretsManager('hatenacorp-github-oauth-token'), }), autoBranchCreation: { patterns: ['staging'], }, }) } }