Skip to content

Commit

Permalink
Merge branch 'aa-development/recruitment' into aa-staging/recruitment
Browse files Browse the repository at this point in the history
merging from aa-development/recruitment to aa-staging/recruitment
  • Loading branch information
ajaywayase committed Jul 5, 2024
2 parents 61430b4 + 8a8859d commit 3a634f2
Show file tree
Hide file tree
Showing 687 changed files with 29,719 additions and 13,037 deletions.
9 changes: 6 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ packages/ @dev-launchers/platform-enablement
# Ideaspace code
apps/ideaspace/ @dev-launchers/ideaspace-team

# UserProfile code
apps/user-profile/ @dev-launchers/User-profile

# Recruitment code
apps/dev-recruiters/ @dev-launchers/dev-recruit-team
apps/dev-recruiters/ @dev-launchers/dev-recruit

# Website code
apps/website/ @Enjoy2Live @pyxld-kris
Expand All @@ -14,7 +17,7 @@ apps/website/ @Enjoy2Live @pyxld-kris
apps/app/ @Enjoy2Live @pyxld-kris

# Code in the backend directory
strapiv4/ @dev-launchers/backend-devs
strapiv4/ @dev-launchers/Backend-Devs

# Deps
package.json @Enjoy2Live
package.json @Enjoy2Live
29 changes: 14 additions & 15 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,22 @@ jobs:
deploy:
# The operating system it will run on
runs-on: ubuntu-latest
continue-on-error: true
outputs:
url: ${{ steps.chromatic.outputs.url }}
buildUrl: ${{ steps.chromatic.outputs.buildUrl }}
storybookUrl: ${{ steps.chromatic.outputs.storybookUrl }}
code: ${{ steps.chromatic.outputs.code }}
branch: ${{ steps.extract_branch.outputs.branch }}
# The list of steps that the action will go through
steps:
- name: Checkout
uses: actions/checkout@v1


- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
id: extract_branch

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
Expand All @@ -35,6 +40,9 @@ jobs:
- name: install deps
run: corepack enable && yarn

- name: generate css
run: yarn workspace @devlaunchers/tailwind build-tw

#👇 Adds Chromatic as a step in the workflow
- name: Chromatic
uses: chromaui/action@v1
Expand All @@ -46,16 +54,7 @@ jobs:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
onlyChanged: true

- name: Discord Channel Notification
env:
DISCORD_WEBHOOK: ${{ secrets.UI_BUILDS_WEBHOOK }}
DISCORD_EMBEDS: '[{"title": "UI changes are ready for review: ${{ github.event.pull_request.comment }}","description": "Started by ${{ github.event.pull_request.user.login }}. Click [here](${{ steps.chromatic.outputs.buildUrl }}) to view the Chromatic review.","url": "${{steps.chromatic.outputs.storybookUrl}}"}]'

uses: Ilshidur/action-discord@master
with:
args: 'New build for {{ EVENT_PAYLOAD.repository.full_name }} Finished.'
- name: Run Storybook tests
run: yarn test-storybook
env:
TARGET_URL: ${{ steps.chromatic.outputs.storybookUrl }}
# - name: Run Storybook tests
# run: yarn test-storybook
# env:
# TARGET_URL: ${{ steps.chromatic.outputs.storybookUrl }}
24 changes: 24 additions & 0 deletions .github/workflows/create-tokens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI
on:
push:
branches:
- "development/design-team"
paths:
- "packages/tailwind-constructor/tokens.json"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2.4.0
# Install dependencies
- run: yarn
# Transform Figma Tokens JSON to something Style Dictionary can read, run Style Dictionary and later run Tailwind
- run: yarn workspace @devlaunchers/tailwind build
# Add files that were created during a run, e.g. created files from style dictionary or token-transformer.
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Tokens
35 changes: 35 additions & 0 deletions .github/workflows/discord-webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Discord Webhook
on:
pull_request:
paths:
- 'packages/UI/.storybook/**'
- 'packages/UI/src/**'
jobs:
discord:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.chromatic.outputs.url }}
buildUrl: ${{ steps.chromatic.outputs.buildUrl }}
storybookUrl: ${{ steps.chromatic.outputs.storybookUrl }}
branch: ${{ steps.extract_branch.outputs.branch }}
pr_number: ${{ steps.extract_pr_number.outputs.pr_number }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "branch=$(echo "${{ github.event.pull_request.head.ref }}" | tr / -)" >> $GITHUB_OUTPUT
id: extract_branch
- name: Extract PR number
shell: bash
run: echo "pr_number=$(echo "$GITHUB_REF" | awk -F / '{print $3}')" >> $GITHUB_OUTPUT
id: extract_pr_number
- name: Discord Channel Notification
env:
BRANCH: ${{ steps.extract_branch.outputs.branch }}
URL: ${{ steps.deploy.outputs.url }}
DISCORD_WEBHOOK: ${{ secrets.UI_BUILDS_WEBHOOK }}
DISCORD_EMBEDS: '[{"title": "Chromatic","description": "View the Chromatic review.","url": "https://www.chromatic.com/pullrequest?appId=632ca21aeea1618b7fa0bf48&number=${{ steps.extract_pr_number.outputs.pr_number }}"}, {"title": "Storybook","description": "View the storybook for this change.","url": "https://${{ steps.extract_branch.outputs.branch }}--632ca21aeea1618b7fa0bf48.chromatic.com/"}]'
uses: Ilshidur/action-discord@master
with:
args: 'New build for ${{ steps.extract_branch.outputs.branch }} has finished. ${{ github.event.head_commit.author.name }} has made changes with the following commit message: ${{ github.event.pull_request.head_commit.message }}'
41 changes: 29 additions & 12 deletions .github/workflows/staging-apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- 'staging/projects[1-2]'
- 'staging/website'
- 'staging/website[1-2]'
- 'staging/user-profile'
- 'staging/user-profile[1-2]'
- 'staging/gptbot'
- 'staging/gptbot[1-2]'

jobs:
Publish:
Expand Down Expand Up @@ -42,13 +46,23 @@ jobs:
shell: bash
run: "sed -ie 's$unoptimized: false$unoptimized: true$g' ./apps/app/next.config.js"

- name: Change environment to the app specific subdomains
run: "sed -ie 's$https://staging.devlaunchers.org$https://${{ steps.extract_branch.outputs.branch }}.devlaunchers.org$g' ./apps/app/.env.staging"

- name: Change environment to staging
run: mv apps/app/.env.staging apps/app/.env.production

- name: generate css
run: yarn workspace @devlaunchers/tailwind build-tw

- name: Run build
run: yarn workspace @devlaunchers/app build

- name: Export
run: yarn workspace @devlaunchers/app export

- name: Publish
if: ${{ !env.ACT }}
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
Expand All @@ -62,16 +76,19 @@ jobs:

#I'm doing this because in cloudflare pages dashboard I created these projects

#- 'ideaspace'
#- 'ideaspace1'
#- 'ideaspace2'
#- 'recruitment'
#- 'recruitment1'
#- 'recruitment2'
#- 'projects'
#- 'projects1'
#- 'projects2'
#- 'website'
#- 'website1'
#- 'website2'
#- 'ideaspace' => ideaspace.pages.dev
#- 'ideaspace1' => ideaspace1.pages.dev
#- 'ideaspace2' => ideaspace2.pages.dev
#- 'recruitment' => recruitment-djw.pages.dev
#- 'recruitment1' => recruitment1.pages.dev
#- 'recruitment2' => recruitment2.pages.dev
#- 'projects' => projects-2w7.pages.dev
#- 'projects1' => projects1-1ut.pages.dev
#- 'projects2' => projects2.pages.dev
#- 'website' => website-386.pages.dev
#- 'website1' => website1-c59.pages.dev
#- 'website2' => website2-7s8.pages.dev
#- 'user-profile' => user-profile-4zw.pages.dev
#- 'user-profile1' => user-profile1.pages.dev
#- 'user-profile2' => user-profile2.pages.dev
#and on every commit that touches the branches of these teams I deploy to the app from the branch name extraction step: Extract branch name
57 changes: 0 additions & 57 deletions .github/workflows/staging-storybook.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ jobs:
push: false
# Get cache from latest build on main branch
cache-from: type=gha
# Don't set cache-to which will export the cache
# Don't set cache-to which will export the cache
build-args: |
NODE_ENV=staging
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ yarn-error.log*

# Storybook
storybook-static

# Tailwind
packages/tailwind-constructor/tailwind.css
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn g:lint-staged-files
# yarn g:codegen
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["dsznajder.es7-react-js-snippets","dbaeumer.vscode-eslint", "bradlc.vscode-tailwindcss","figma.figma-vscode-extension" ],
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tailwindCSS.experimental.configFile": "packages/tailwind-constructor/tailwind.config.js",
"tailwindCSS.experimental.classRegex": [
["tv\\((([^()]*|\\([^()]*\\))*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
]
}
51 changes: 51 additions & 0 deletions .vscode/typescriptreact.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"Create a component": {
"prefix": "comp",
"body": [
"import * as React from 'react';",
"import { tv, type VariantProps } from 'tailwind-variants';",
"",
"const $1Styles = tv({",
" slots: {$2},",
" variants: {$3},",
"});",
"",
"interface $1Props extends VariantProps<typeof $1Styles> {}",
"",
"const $1 = ({}: $1Props) => {",
" return <div>$0</div>;",
"};",
"",
"$1.displayName = '$1';",
"export default $1;",
""
],
"description": "Create a component"
},
"create a sample story": {
"prefix": "story",
"body": [
"import type { Meta, StoryObj } from '@storybook/react';",
"",
"import $1 from './$1';",
"",
"const meta: Meta<typeof $1> = {",
" component: $1,",
"};",
"",
"export default meta;",
"type Story = StoryObj<typeof $1>;",
"",
"/*",
" *👇 Render functions are a framework specific feature to allow you control on how the component renders.",
" * See https://storybook.js.org/docs/react/api/csf",
" * to learn how to use render functions.",
" */",
"export const Primary: Story = {",
" render: () => <$1 />,",
"};",
""
],
"description": "create a sample story"
}
}
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ ENV PRISMA_CLI_BINARY_TARGETS=linux-musl
# Does not play well with buildkit on CI
# https://github.com/moby/buildkit/issues/1673

# Make sure the env is set to be CI
ENV CI=true

RUN --mount=type=cache,target=/root/.yarn3-cache,id=yarn3-cache \
YARN_CACHE_FOLDER=/root/.yarn3-cache \
yarn install --immutable --inline-builds
Expand All @@ -74,6 +77,8 @@ FROM node:14.19.3-bullseye AS builder
ARG NODE_ENV=production
ENV NEXTJS_IGNORE_ESLINT=1
ENV NEXTJS_IGNORE_TYPECHECK=0
# Make sure the env is set to be CI
ENV CI=true

WORKDIR /app

Expand All @@ -84,6 +89,7 @@ COPY --from=deps /workspace-install ./
RUN if [ "${NODE_ENV}" = "staging" ]; then mv ./apps/app/.env.staging ./apps/app/.env.production ; fi

# # Optional: if the app depends on global /static shared assets like images, locales...
RUN yarn workspace @devlaunchers/tailwind build-tw
RUN yarn workspace @devlaunchers/app build

# Does not play well with buildkit on CI
Expand Down Expand Up @@ -112,12 +118,18 @@ COPY --from=builder /app/apps/website/next.config.js \
COPY --from=builder /app/apps/ideaspace/next.config.js \
/app/apps/ideaspace/package.json \
./apps/ideaspace/
COPY --from=builder /app/apps/user-profile/next.config.js \
/app/apps/user-profile/package.json \
./apps/user-profile/
COPY --from=builder /app/apps/site-projects/next.config.js \
/app/apps/site-projects/package.json \
./apps/site-projects/
COPY --from=builder /app/apps/dev-recruiters/next.config.js \
/app/apps/dev-recruiters/package.json \
./apps/dev-recruiters/
COPY --from=builder /app/apps/gptbot/next.config.js \
/app/apps/gptbot/package.json \
./apps/gptbot/
COPY --from=builder /app/apps/app/public ./apps/app/public
COPY --from=builder --chown=nextjs:nodejs /app/apps/app/.next ./apps/app/.next
COPY --from=builder --chown=nextjs:nodejs /app/apps/app/.env.production ./apps/app/.env.production
Expand Down
Loading

0 comments on commit 3a634f2

Please sign in to comment.