Skip to content
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

Enable Github Actions / PROD deployment to AWS #1

Merged
merged 24 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b425f91
feat: Add AWS PROD deployment support via SST
fastner Jul 23, 2024
d5e9a71
feat: enable build via gitub actions
fastner Jul 23, 2024
3a9278f
chore: update pnpm
fastner Jul 23, 2024
e020e65
feat: enable deployment of build to AWS prod account
fastner Jul 23, 2024
1778c41
feat: Request AWS access keys from github repo secrets
fastner Jul 23, 2024
b202472
refactor: Run PROD deployment on push to main branch
fastner Jul 23, 2024
cede132
feat: eslint only source files
fastner Jul 23, 2024
b9adc2f
chore: Remove linting errors and replace with TODOs
fastner Jul 23, 2024
a2ffa8c
chore: Prettier files
fastner Jul 23, 2024
7827dce
feat: add test for every push
fastner Jul 23, 2024
fbbfecc
fix: Rename test run on CI
fastner Jul 23, 2024
32fb137
chore: Fix linting
fastner Jul 23, 2024
e5348ba
feat: migrate to sst@ion
fastner Jul 23, 2024
f0790bf
chore: fix format
fastner Jul 23, 2024
b63eb2d
feat: Add cloudflare DNS API credentials (from github secrets)
fastner Jul 23, 2024
3cb42c5
feat: add sst branch to github actions PROD task to test deployment
fastner Jul 23, 2024
7d80337
fix: Initialize sst before running test
fastner Jul 23, 2024
f98bd9f
Merge pull request #2 from sebastian-software/sst-ion
fastner Jul 23, 2024
77deeab
fix: rename sst env definition file to autocreated one
fastner Jul 23, 2024
7472f5b
feat: add more log output for deployment
fastner Jul 23, 2024
f6cd2e0
fix: unset AWS profile
fastner Jul 23, 2024
89ee76e
fix: unset AWS profile only in CI mode
fastner Jul 23, 2024
26c24b4
feat: remove verbose log outputs in deployment script
fastner Jul 23, 2024
39c3552
fix: ignore autogenerated sst definition file in linting process
fastner Jul 23, 2024
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
23 changes: 23 additions & 0 deletions .github/workflows/github-actions-prod-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: GitHub Actions Prod Deployment
on:
push:
branches:
- main
- sst

jobs:
DeployToProd:
runs-on: ubuntu-latest
env: # Defined in the repository settings on github.com
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CLOUDFLARE_DEFAULT_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_DEFAULT_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: corepack enable
- run: pnpm i
- run: pnpm deploy:prod
17 changes: 17 additions & 0 deletions .github/workflows/github-actions-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: GitHub Actions Test
on:
- push

jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: corepack enable
- run: pnpm i
- run: pnpm sst install
- run: pnpm test
- run: pnpm build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
.env
.vercel
.DS_Store
.sst
3 changes: 3 additions & 0 deletions app/components/banner/Banner.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export const rootClass = style({
backgroundRepeat: "repeat, no-repeat",
color: "white",
height: "35vw",

// TODO: how to remove @typescript-eslint/no-magic-numbers
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
filter: dropShadow[3]
})

Expand Down
2 changes: 2 additions & 0 deletions app/components/banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { PropsWithChildren } from "react"
import { contentClass, rootClass } from "./Banner.css"

export interface BannerProps extends PropsWithChildren {
// TODO: how to remove react/no-unused-prop-types
// eslint-disable-next-line react/no-unused-prop-types
readonly title: string
}

Expand Down
4 changes: 0 additions & 4 deletions app/components/button/Button.css.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { buildSpectrum } from "@effective/color"
import { style } from "@vanilla-extract/css"

const gold = buildSpectrum("C89F6B")
const magenta = buildSpectrum("C50044")

export const root = style({})
19 changes: 11 additions & 8 deletions app/components/card/Card.css.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { buildShades, buildSpectrum } from "@effective/color"
import { style } from "@vanilla-extract/css"

import { elenaWebfont } from "../fonts/elena/Elena.css"
import { darkViolet, goldShades, violetShades } from "~/styles/colors"

const gold = buildSpectrum("C89F6B")
const magenta = buildSpectrum("C50044")
const goldShades = buildShades("#fff", "C89F6B")
const darkViolet = buildSpectrum("3F2B3D")
const violetShades = buildShades("#fff", "3F2B3D")
const tealSpectrum = buildSpectrum("22404B")
import { elenaWebfont } from "../fonts/elena/Elena.css"

export const root = style({
width: "40ch",
border: "1px solid",

// TODO: how to remove no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
background: `radial-gradient(at right bottom, ${goldShades[3]}, white)`,
borderColor: "white",
padding: "2rem",
borderRadius: "0.5rem",

// TODO: how to remove @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-magic-numbers
color: violetShades[4],
position: "relative",

Expand Down
4 changes: 4 additions & 0 deletions app/components/footer/Footer.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { style } from "@vanilla-extract/css"
const darkViolet = buildSpectrum("3F2B3D")

export const root = style({
// TODO: how to remove no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
background: darkViolet["-2"],
// TODO: how to remove no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
color: darkViolet["+5"],
paddingInline: "2vw",
paddingBlock: "1rem",
Expand Down
10 changes: 10 additions & 0 deletions app/components/header/Header.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ const darkViolet = buildSpectrum("3F2B3D")

export const root = style({
// background: `linear-gradient(to bottom, ${vivaMagenta["0"]}, ${vivaMagenta["-2"]} )`,
// TODO: how to remove no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
background: darkViolet["-2"],
// TODO: how to remove no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
color: darkViolet["+5"],
display: "flex",
flexDirection: "row",
Expand All @@ -15,7 +19,13 @@ export const root = style({
paddingBlock: "1rem",
paddingInline: "2rem",
borderBottom: "1px solid",

// TODO: how to remove no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
borderColor: darkViolet["+5"],

// TODO: how to remove no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
filter: dropShadow[5],
zIndex: 1000,
marginBottom: "0rem"
Expand Down
2 changes: 2 additions & 0 deletions app/components/main/Main.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { style } from "@vanilla-extract/css"
const darkViolet = buildSpectrum("3F2B3D")

export const root = style({
// TODO: how to remove no-unsafe-assignment
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
color: darkViolet["0"],
flexGrow: 1
})
8 changes: 8 additions & 0 deletions app/styles/colors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { buildShades, buildSpectrum } from "@effective/color"

export const gold = buildSpectrum("C89F6B")
export const magenta = buildSpectrum("C50044")
export const darkViolet = buildSpectrum("3F2B3D")

export const violetShades = buildShades("#fff", "3F2B3D")
export const goldShades = buildShades("#fff", "C89F6B")
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { main } from "@effective/eslint-config"

export default [
{
ignores: [".*/**/*", "build/**/*", "sst-env.d.ts"]
},
main,
{
files: ["**/*.css.ts"],
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
"sideEffects": false,
"type": "module",
"scripts": {
"check-types": "tsc",
"lint": "eslint .",
"test": "pnpm run --parallel /test:/",
"test:check-types": "tsc --noEmit",
"test:lint": "eslint .",
"fix": "eslint --fix .; prettier --write .",
"format": "prettier --write .",
"check-format": "prettier --check .",
"test:check-format": "prettier --check .",
"build": "remix vite:build",
"dev": "remix vite:dev",
"start": "remix-serve ./build/server/index.js",
"opt:svg": "svgo --folder app --recursive",
"update:latest": "ncu --deep --upgrade --interactive",
"update:minor": "ncu --deep --upgrade --interactive --target minor",
"update:pnpm": "corepack up"
"update:pnpm": "corepack up",
"deploy:prod": "sst deploy --stage production"
},
"dependencies": {
"@effective/shadow": "^1.0.1",
Expand All @@ -41,12 +43,13 @@
"eslint": "^8.57.0",
"npm-check-updates": "^16.14.20",
"prettier": "^3.3.3",
"sst": "ion",
"svgo": "^3.3.2",
"typescript": "^5.5.3",
"vite": "^5.3.4",
"vite-tsconfig-paths": "^4.3.2"
},
"packageManager": "pnpm@9.5.0+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903",
"packageManager": "pnpm@9.6.0+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e",
"engines": {
"node": ">=18.0.0"
}
Expand Down
Loading