Skip to content

feat(construct): updating to newer cdk "Distribution", more aggressiv… #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Serverless UI Build & Deploy Example Site
name: Serverless UI Build & Deploy Example Sites

on: [pull_request]

jobs:
deploy-pr-preview:
deploy-simple-preview:
runs-on: ubuntu-latest

steps:
Expand All @@ -22,7 +22,8 @@ jobs:
aws-region: us-west-2
- run: lerna bootstrap
- run: lerna run prepack
- run: yarn sui deploy --compiled-build --dir="./example-site/dist" --functions="./example-site/functions"
- run: cd examples/simple && yarn install
- run: yarn sui deploy --compiled-build --dir="./examples/simple/dist" --functions="./examples/simple/functions"
- name: Add PR Comment
uses: actions/github-script@v3
with:
Expand All @@ -42,3 +43,24 @@ jobs:
repo: context.repo.repo,
body: `✅ Your deploy preview is ready: ${template.Outputs[baseUrlKey].Value}`,
});
deploy-gatsby-preview:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
- run: npm install -g aws-cdk
- run: npm install -g lerna
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- run: lerna bootstrap
- run: lerna run prepack
- run: cd examples/gatsby && yarn install && yarn build
- run: yarn sui deploy --compiled-build --dir="./examples/gatsby/public"
67 changes: 0 additions & 67 deletions example-site/package-lock.json

This file was deleted.

3 changes: 3 additions & 0 deletions examples/gatsby/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.cache/
public
12 changes: 12 additions & 0 deletions examples/gatsby/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Gatsby Example Website for Serverless UI

This is simple Gatsby website that can be deployed with Serverless UI. We use this website for integration tests in this repository.

Try it yourself with:

```shell
npm install -g @serverlessui/cli
npm install
npm run build
sui deploy --dir="public"
```
25 changes: 25 additions & 0 deletions examples/gatsby/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
siteMetadata: {
title: "gatsby",
},
plugins: [
"gatsby-plugin-image",
"gatsby-plugin-react-helmet",
{
resolve: "gatsby-plugin-manifest",
options: {
icon: "src/images/icon.png",
},
},
"gatsby-plugin-sharp",
"gatsby-transformer-sharp",
{
resolve: "gatsby-source-filesystem",
options: {
name: "images",
path: "./src/images/",
},
__key: "images",
},
],
};
33 changes: 33 additions & 0 deletions examples/gatsby/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "gatsby",
"version": "1.0.0",
"private": true,
"description": "gatsby",
"author": "Jake Partusch",
"keywords": [
"gatsby"
],
"scripts": {
"develop": "gatsby develop",
"start": "gatsby develop",
"build": "gatsby build",
"serve": "gatsby serve",
"clean": "gatsby clean"
},
"dependencies": {
"gatsby": "^3.0.1",
"gatsby-plugin-image": "^1.0.0",
"gatsby-plugin-manifest": "^3.0.0",
"gatsby-plugin-react-helmet": "^4.0.0",
"gatsby-plugin-sharp": "^3.0.0",
"gatsby-plugin-sitemap": "^3.0.0",
"gatsby-source-filesystem": "^3.0.0",
"gatsby-transformer-sharp": "^3.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0"
},
"devDependencies": {
"esbuild": "^0.8.56"
}
}
Binary file added examples/gatsby/src/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions examples/gatsby/src/pages/404.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import * as React from "react"
import { Link } from "gatsby"

// styles
const pageStyles = {
color: "#232129",
padding: "96px",
fontFamily: "-apple-system, Roboto, sans-serif, serif",
}
const headingStyles = {
marginTop: 0,
marginBottom: 64,
maxWidth: 320,
}

const paragraphStyles = {
marginBottom: 48,
}
const codeStyles = {
color: "#8A6534",
padding: 4,
backgroundColor: "#FFF4DB",
fontSize: "1.25rem",
borderRadius: 4,
}

// markup
const NotFoundPage = () => {
return (
<main style={pageStyles}>
<title>Not found</title>
<h1 style={headingStyles}>Page not found</h1>
<p style={paragraphStyles}>
Sorry{" "}
<span role="img" aria-label="Pensive emoji">
😔
</span>{" "}
we couldn’t find what you were looking for.
<br />
{process.env.NODE_ENV === "development" ? (
<>
<br />
Try creating a page in <code style={codeStyles}>src/pages/</code>.
<br />
</>
) : null}
<br />
<Link to="/">Go home</Link>.
</p>
</main>
)
}

export default NotFoundPage
Loading