Skip to content

Commit

Permalink
Merge pull request #4170 from signalco-io/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
AleksandarDev authored Dec 22, 2023
2 parents c29650e + 7b51a32 commit 8b0db30
Show file tree
Hide file tree
Showing 20 changed files with 178 additions and 227 deletions.
101 changes: 19 additions & 82 deletions .github/workflows/cloud-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: "[Cloud] Deploy"
name: "[Infra] Deploy"

on:
push:
Expand All @@ -9,86 +9,23 @@ on:
- "cloud/**"
- "infra/**"
- ".github/workflows/cloud-deploy.yml"

env:
DOTNET_VERSION: "7.0.x" # set this to the dotnet version to use

defaults:
run:
working-directory: ./infra
- ".github/workflows/infra-deploy_reusable.yml"

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@v4

- name: ✋ Set up mutex
id: mutex-setup
run: |
pushd ../discrete/Signalco.Discrete.Api.Mutex/node-cli
npm install
npm install -g
npx mutex wait signalcoclouddeploy
popd
- name: ✨ Setup DotNet ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: ✨ Setup pnpm
uses: pnpm/[email protected]
with:
version: 'latest'

- name: ✨ Setup Node LTS
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: pnpm
cache-dependency-path: ./infra

- name: 📦️ Installing dependencies
run: pnpm i --frozen-lockfile

- name: 🔎 Determine stack
shell: bash
run: |
[[ $(echo ${GITHUB_REF#refs/heads/}) = "main" ]] && echo "##[set-output name=branch;]production" || echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
env:
BASE_BRANCH: ${{ github.base_ref }}

- name: ⚒️ Build Infrastructure
run: pnpm build

- name: ⚡ Deploy signalco Infrastructure
uses: pulumi/actions@v4
with:
command: up
stack-name: signalco/cloud-primary/${{ steps.extract_branch.outputs.branch }}
work-dir: ./infra/apps/cloud-primary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

- name: ⚡ Deploy uier Infrastructure
uses: pulumi/actions@v4
with:
command: up
stack-name: signalco/uier/${{ steps.extract_branch.outputs.branch }}
work-dir: ./infra/apps/uier
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

- name: ✋ Release mutex
if: always() && steps.mutex-setup.outcome == 'success'
run: |
pushd ../discrete/Signalco.Discrete.Api.Mutex/node-cli
npm install
npm install -g
npx mutex release signalcoclouddeploy
popd
infra_cloud-primary_up:
name: "Cloud Primary infrastructure (deploy)"
uses: ./.github/workflows/infra-deploy_reusable.yml
with:
project: "cloud-primary"
baseRef: ${{ github.ref }}
command: "up"
secrets: inherit

infra_uier_up:
name: "uier infrastructure (deploy)"
uses: ./.github/workflows/infra-deploy_reusable.yml
with:
project: "uier"
baseRef: ${{ github.ref }}
command: "up"
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: "[Cloud] Preview Deploy"
name: "[Infra] Deploy"

on:
workflow_call:
Expand All @@ -13,13 +13,20 @@ on:
required: true
type: string
description: "The base branch to deploy to"
command:
required: true
type: string
description: "The Pulumi command to run - preview, up, destroy, etc."

defaults:
run:
working-directory: ./infra

env:
DOTNET_VERSION: "7.0.x" # set this to the dotnet version to use

jobs:
build-and-preview:
infra-build-and-execute:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
Expand All @@ -31,28 +38,28 @@ jobs:
pushd ../discrete/Signalco.Discrete.Api.Mutex/node-cli
npm install
npm install -g
npx mutex wait signalcoinfrapreview${{ inputs.project }}
npx mutex wait signalcoinfra${{ inputs.command }}${{ inputs.project }}
popd
- name: ✨ Setup DotNet
- name: ✨ Setup DotNet ${{ env.DOTNET_VERSION }} Environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: "7.0.x"
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: ✨ Setup pnpm
uses: pnpm/[email protected]
with:
version: 'latest'

- name: ✨ Setup Node LTS
- name: ✨ Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: pnpm
cache-dependency-path: ./infra

- name: 📦️ Installing dependencies
run: pnpm i --frozen-lockfile
run: pnpm i --frozen-lockfile --filter=${{ inputs.project }}

- name: 🔎 Determine stack
shell: bash
Expand All @@ -68,12 +75,12 @@ jobs:
BASE_BRANCH: ${{ inputs.baseRef }}

- name: ⚒️ Build Infrastructure
run: pnpm build
run: pnpm build --filter=${{ inputs.project }}

- name: ⚡ Preview Deploy Infrastructure
uses: pulumi/actions@v4
with:
command: preview
command: ${{ inputs.command }}
stack-name: signalco/${{ inputs.project }}/${{ steps.extract_branch.outputs.stack }}
work-dir: ./infra/apps/${{ inputs.project }}
comment-on-pr: true
Expand All @@ -87,5 +94,5 @@ jobs:
pushd ../discrete/Signalco.Discrete.Api.Mutex/node-cli
npm install
npm install -g
npx mutex release signalcoinfrapreview${{ inputs.project }}
npx mutex release signalcoinfra${{ inputs.command }}${{ inputs.project }}
popd
8 changes: 5 additions & 3 deletions .github/workflows/web-nextjs_bundle_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,23 @@ on:

jobs:
cloud_preview:
name: "Cloud (preview)"
uses: ./.github/workflows/cloud-deploy-preview_reusable.yml
name: "Cloud Primary infrastructure (preview)"
uses: ./.github/workflows/infra-deploy_reusable.yml
if: success() && github.event_name == 'pull_request'
with:
project: "cloud-primary"
baseRef: ${{ github.base_ref }}
command: "preview"
secrets: inherit

uier_infra_preview:
name: "uier infrastructure (preview)"
uses: ./.github/workflows/cloud-deploy-preview_reusable.yml
uses: ./.github/workflows/infra-deploy_reusable.yml
if: success() && github.event_name == 'pull_request'
with:
project: "uier"
baseRef: ${{ github.base_ref }}
command: "preview"
secrets: inherit

analyze_blog:
Expand Down
8 changes: 4 additions & 4 deletions infra/apps/cloud-primary/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@infra/signalco",
"name": "@infra/cloud-primary",
"private": true,
"license": "../LICENSE",
"main": "dist/index.js",
Expand All @@ -18,7 +18,7 @@
"eslint": "8.56.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "16.4.0",
"eslint-plugin-n": "16.5.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.1.1",
"tsup": "8.0.1",
Expand All @@ -27,11 +27,11 @@
"dependencies": {
"@checkly/pulumi": "1.1.4",
"@pulumi/aws": "6.15.0",
"@pulumi/azure-native": "2.22.1",
"@pulumi/azure-native": "2.23.0",
"@pulumi/cloudflare": "5.16.0",
"@pulumi/command": "0.9.2",
"@pulumi/docker": "4.5.0",
"@pulumi/pulumi": "3.98.0",
"@pulumi/pulumi": "3.99.0",
"@pulumiverse/vercel": "1.0.1"
}
}
6 changes: 3 additions & 3 deletions infra/apps/remote-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"eslint": "8.56.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "16.4.0",
"eslint-plugin-n": "16.5.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.1.1",
"tsup": "8.0.1",
Expand All @@ -23,11 +23,11 @@
"dependencies": {
"@checkly/pulumi": "1.1.4",
"@pulumi/aws": "6.15.0",
"@pulumi/azure-native": "2.22.1",
"@pulumi/azure-native": "2.23.0",
"@pulumi/cloudflare": "5.16.0",
"@pulumi/command": "0.9.2",
"@pulumi/docker": "4.5.0",
"@pulumi/pulumi": "3.98.0",
"@pulumi/pulumi": "3.99.0",
"@pulumiverse/vercel": "1.0.1"
}
}
2 changes: 2 additions & 0 deletions infra/apps/uier/Pulumi.next.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
config:
cloudflare:apiToken:
secure: AAABAAqPzyAV9mvmavpxCxB+Ws+snM4JK8mNiAxa+WqmzniW5gNmJpHXGgXZI69SkL251Lhhrp43BUrvHnTEbAFf3lG8/Wsl
uier:zoneid:
secure: AAABAJK2ySr7F+7XlKpMjtxnW6fzUm06HdbFbM5lVT6isD2OQ36zJO+sg5NVhGrF+SnbDe4wYL1TIyDsDR7Sxw==
vercel:apiToken:
secure: AAABAA4uxruLwvuYUDigNjy8yKK8Q3fYt/nM8JmX+RWMNsAMCiDNTbw8uFgFetLzaM4ZkQyLh/8=
vercel:team: team_Ade0MlfC3211ml3wYJZ4c9hn
2 changes: 2 additions & 0 deletions infra/apps/uier/Pulumi.production.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
config:
cloudflare:apiToken:
secure: AAABACGEfMwr2aNFBpAz+WdsfG/AgG31Ktvpe0KVGFCpoiCN8wjhe7NJYY4NJT3o/M+q8x85EOwn3Q9CfljxdPEUq4SPuXxo
uier:zoneid:
secure: AAABAPxKQi4LwTWTzWHQkIS6gaaasxCftcUlYDqlVjkiaobpZ7v2NpYRpaFjlBjqSX3uRfU145qJ/vp0PFfhYA==
vercel:apiToken:
secure: AAABAIqY6swLmFBuXsBC1nImEqM4nxOHyxnJn61fsVuM5MrM/gif2yN6U8ZkY5f/lIEQB9H/kSM=
vercel:team: team_Ade0MlfC3211ml3wYJZ4c9hn
6 changes: 3 additions & 3 deletions infra/apps/uier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"eslint": "8.56.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "16.4.0",
"eslint-plugin-n": "16.5.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.1.1",
"tsup": "8.0.1",
Expand All @@ -27,11 +27,11 @@
"dependencies": {
"@checkly/pulumi": "1.1.4",
"@pulumi/aws": "6.15.0",
"@pulumi/azure-native": "2.22.1",
"@pulumi/azure-native": "2.23.0",
"@pulumi/cloudflare": "5.16.0",
"@pulumi/command": "0.9.2",
"@pulumi/docker": "4.5.0",
"@pulumi/pulumi": "3.98.0",
"@pulumi/pulumi": "3.99.0",
"@pulumiverse/vercel": "1.0.1"
}
}
2 changes: 1 addition & 1 deletion infra/apps/uier/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const up = async () => {
});

if (stack === 'next') {
dnsRecord('vercel-uier', 'uier', 'cname.vercel-dns.com', 'CNAME', false);
dnsRecord('vercel-uier', 'next', 'cname.vercel-dns.com', 'CNAME', false);
} else if (stack === 'production') {
// TODO: Handle A record for production
}
Expand Down
6 changes: 3 additions & 3 deletions infra/packages/pulumi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
"eslint": "8.56.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "16.4.0",
"eslint-plugin-n": "16.5.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.1.1",
"typescript": "5.3.3"
},
"dependencies": {
"@checkly/pulumi": "1.1.4",
"@pulumi/aws": "6.15.0",
"@pulumi/azure-native": "2.22.1",
"@pulumi/azure-native": "2.23.0",
"@pulumi/cloudflare": "5.16.0",
"@pulumi/command": "0.9.2",
"@pulumi/docker": "4.5.0",
"@pulumi/pulumi": "3.98.0",
"@pulumi/pulumi": "3.99.0",
"@pulumiverse/vercel": "1.0.1"
}
}
Loading

8 comments on commit 8b0db30

@vercel
Copy link

@vercel vercel bot commented on 8b0db30 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

signalco-slco – ./web/apps/slco

signalco-slco-signalco.vercel.app
signalco-slco-git-main-signalco.vercel.app
slco.io
signalco-slco.vercel.app
slco.signalco.io

@vercel
Copy link

@vercel vercel bot commented on 8b0db30 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

signalco-app – ./web/apps/app

app.signalco.io
signalco-app.vercel.app
signalco-app-signalco.vercel.app
signalco-app-git-main-signalco.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 8b0db30 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

signalco-blog – ./web/apps/blog

signalco-blog-signalco.vercel.app
signalco-blog.vercel.app
blog.signalco.io
signalco-blog-git-main-signalco.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 8b0db30 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

signalco-ui-docs – ./web/apps/ui-docs

signalco-ui-docs-git-main-signalco.vercel.app
signalco-ui-docs.vercel.app
signalco-ui-docs-signalco.vercel.app
ui.signalco.io

@vercel
Copy link

@vercel vercel bot commented on 8b0db30 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8b0db30 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

signalco-uier – ./web/apps/uier

signalco-uier-git-main-signalco.vercel.app
signalco-uier.vercel.app
signalco-uier-signalco.vercel.app
next.uier.io

@vercel
Copy link

@vercel vercel bot commented on 8b0db30 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8b0db30 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.