Skip to content

Commit

Permalink
feat: v3.1
Browse files Browse the repository at this point in the history
based on feedback from using the v3 version
  • Loading branch information
FilipPyrek committed Feb 12, 2024
1 parent 9b72ea0 commit cf5a68b
Show file tree
Hide file tree
Showing 23 changed files with 1,375 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root = true
end_of_line = lf
insert_final_newline = true

[*.{js,jsx,json,ts,tsx}]
[*.{js,jsx,json,ts,tsx,cjs,mjs}]
charset = utf-8
indent_style = tab
indent_size=2
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy
name: Deploy Branch
on:
workflow_dispatch:
push:
Expand All @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand All @@ -31,10 +31,10 @@ jobs:
run: pnpm install

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ github.ref == 'refs/heads/master' && 'CHANGE_ME' || 'CHANGE_ME' }}
aws-region: eu-central-1 # Is not relate to deployment region
aws-region: eu-central-1 # Is not related to deployment region
role-session-name: CHANGE_ME

- name: Deploy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
name: Create Release

name: Release Prod
on:
workflow_run:
workflows: [Deploy]
branches: [master]
types: [completed]

push:
branches:
- master
permissions:
contents: write
jobs:
create_release_notes:
if: github.ref_type == 'branch' && github.ref_name == 'master'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand All @@ -38,6 +36,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check if there is anything worth a releasing
run: |
[ -s version.txt ] || exit 1
- name: Create Release
run: |
gh api \
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/remove.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ permissions:
contents: read # This is required for actions/checkout
jobs:
deploy:
# We don't want to remove protected deployment
if: github.ref_protected == false
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand All @@ -27,10 +29,10 @@ jobs:
run: pnpm install

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ github.ref == 'refs/heads/master' && 'CHANGE_ME' || 'CHANGE_ME' }}
aws-region: eu-central-1 # Is not relate to deployment region
role-to-assume: ${{ github.ref == 'refs/heads/master' && 'CHANGE_ME' || 'CHANGE_ME' }}
aws-region: eu-central-1 # Is not related to deployment region
role-session-name: CHANGE_ME

- name: Deploy
Expand Down
24 changes: 19 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
name: Test
name: Test Branch
on:
workflow_dispatch:
push:
branches:
- f/*
- master
- staging

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # In order for commitlint to check historic commits

- name: Install pnpm
uses: pnpm/action-setup@v2
Expand All @@ -38,12 +41,23 @@ jobs:
run: pnpm run lint

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ github.ref == 'refs/heads/master' && 'CHANGE_ME' || 'CHANGE_ME' }}
aws-region: eu-central-1 # Is not relate to deployment region
aws-region: eu-central-1 # Is not related to deployment region
role-session-name: CHANGE_ME

# https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#github-actions
- name: Next.js cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/services/frontend/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('services/frontend/**/*.js', 'services/frontend/**/*.jsx', 'services/frontend/**/*.ts', 'services/frontend/**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
- name: Type check
run: pnpm run ci:typecheck:all

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ out

# misc
.DS_Store

# CDK
cdk.context.json
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"esbenp.prettier-vscode",
"styled-components.vscode-styled-components",
"vivaxy.vscode-conventional-commits",
"SebastianBille.iam-legend"
"SebastianBille.iam-legend",
"bradlc.vscode-tailwindcss"
]
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
"env": "env-cmd -f ./.env bash -c \"ssocreds -p \\$AWS_PROFILE\" && env-cmd -f ./.env",
"env:vscode": "pnpm run env echo 1",
"prepare": "husky install",
"lint": "eslint 'services' 'packages' 'constructs' --ext .ts,.tsx,.js,.jsx && prettier -c \"**/*.{json,graphql,gql,html}\"",
"lint:fix": "eslint 'services' 'packages' 'constructs' --ext .ts,.tsx,.js,.jsx --fix && prettier --write \"**/*.{json,graphql,gql,html}\"",
"start": "pnpm run env -- sst start",
"lint": "eslint 'services' 'packages' 'constructs' --ext .ts,.tsx,.js,.jsx,.cjs,.mjs && prettier -c \"**/*.{json,graphql,gql,html}\"",
"lint:fix": "eslint 'services' 'packages' 'constructs' --ext .ts,.tsx,.js,.jsx,.cjs,.mjs --fix && prettier --write \"**/*.{json,graphql,gql,html}\"",
"dev": "pnpm run env -- sst dev",
"build": "pnpm run env -- sst build",
"deploy": "pnpm run env -- sst deploy",
"remove": "pnpm run env -- sst remove",
"sst-types": "pnpm run env -- sst types",
"console": "pnpm run env -- sst console",
"secrets": "pnpm run env -- sst secrets",
"test": "vitest run",
Expand Down
Loading

0 comments on commit cf5a68b

Please sign in to comment.