Skip to content

Commit

Permalink
Add frontend_example CD
Browse files Browse the repository at this point in the history
  • Loading branch information
domdomegg committed Apr 20, 2024
1 parent edaef21 commit 5ea11cd
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 5 deletions.
39 changes: 35 additions & 4 deletions .github/workflows/ci_cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ jobs:
- 'apps/bubble-proxy/**'
frontend-example:
paths:
- 'apps/bubble-proxy/**'
- 'apps/frontend-example/**'
infra:
paths:
- 'apps/infra/**'
miniextensions-proxy:
paths:
- 'apps/miniextensions-proxy/**'
paths:
- 'package-lock.json'
outputs:
Expand All @@ -74,7 +77,6 @@ jobs:
run: npm ci

- name: Configure for deployment
if: github.ref == 'refs/heads/master'
run: |
echo "$INFRA_PULUMI_PASSPHRASE" > apps/infra/passphrase.prod.txt
Expand All @@ -85,5 +87,34 @@ jobs:
# See the infra README - these should actually have details for Vultr Object Storage
INFRA_AWS_CREDENTIALS: ${{ secrets.INFRA_AWS_CREDENTIALS }}
- name: Deploy
if: ${{ github.ref == 'refs/heads/master' }}
run: npm run deploy:prod --workspace apps/infra
run: npm run deploy:prod --workspace apps/infra

cd_frontend-example:
needs: ci
if: ${{ github.ref == 'refs/heads/master' && needs.ci.outputs.should_skip != 'true' || !fromJSON(needs.ci.outputs.paths_result).frontend-example.should_skip }}
runs-on: ubuntu-latest
concurrency:
group: prevent-concurrent-jobs
timeout-minutes: 10
steps:
- name: Checkout ${{ github.sha }}
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install NPM dependencies
run: npm ci

- name: Configure for deployment
run: |
docker login https://sjc.vultrcr.com/bluedot -u dbaa58f3-01f1-4fcc-9c14-93cc28f524e0 -p $VULTR_CONTAINER_REGISTRY_PASSWORD
mkdir -p ~/.kube
echo "$K8S_KUBECONFIG" > ~/.kube/config
env:
K8S_KUBECONFIG: ${{ secrets.K8S_KUBECONFIG }}
VULTR_CONTAINER_REGISTRY_PASSWORD: ${{ secrets.VULTR_CONTAINER_REGISTRY_PASSWORD }}
- name: Deploy
run: npm run deploy:prod --workspace apps/frontend-example
2 changes: 2 additions & 0 deletions apps/backend/tools/deployDocker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euxo pipefail

cd $(dirname "${BASH_SOURCE[0]:-$0}")/..

APP_NAME=$(basename "$PWD")
REPO_URL="sjc.vultrcr.com/bluedot"
IMAGE_NAME="bluedot-$APP_NAME"
Expand Down
2 changes: 2 additions & 0 deletions apps/bubble-proxy/tools/deployDocker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euxo pipefail

cd $(dirname "${BASH_SOURCE[0]:-$0}")/..

APP_NAME=$(basename "$PWD")
REPO_URL="sjc.vultrcr.com/bluedot"
IMAGE_NAME="bluedot-$APP_NAME"
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend-example/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const HomePage = () => {

return (
<div className="mx-8">
<H1>Homepage</H1>
<H1>frontend-example</H1>
<P>This is some example text</P>
<Button onPress={() => setCount((c) => c + 1)}>
count is {count}
Expand Down
2 changes: 2 additions & 0 deletions apps/frontend-example/tools/deployDocker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euxo pipefail

cd $(dirname "${BASH_SOURCE[0]:-$0}")/..

APP_NAME=$(basename "$PWD")
REPO_URL="sjc.vultrcr.com/bluedot"
IMAGE_NAME="bluedot-$APP_NAME"
Expand Down
2 changes: 2 additions & 0 deletions apps/miniextensions-proxy/tools/deployDocker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euxo pipefail

cd $(dirname "${BASH_SOURCE[0]:-$0}")/..

APP_NAME=$(basename "$PWD")
REPO_URL="sjc.vultrcr.com/bluedot"
IMAGE_NAME="bluedot-$APP_NAME"
Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5ea11cd

Please sign in to comment.