updating infrastructure
This commit is contained in:
58
.github/workflows/api_build.yaml
vendored
58
.github/workflows/api_build.yaml
vendored
@@ -1,58 +0,0 @@
|
||||
name: 'API Build'
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
environment_name:
|
||||
required: true
|
||||
type: string
|
||||
version_number:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ inputs.environment_name }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
api
|
||||
|
||||
- name: Install Nest CLI
|
||||
run: |
|
||||
npm install -g @nestjs/cli
|
||||
|
||||
- name: 'Setup Node'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ vars.NODE_VERSION }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm ci
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
npm run build
|
||||
|
||||
- name: Log into Docker Hub
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push to registry
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: noahspan/flying-api:${{ inputs.version_number }}
|
||||
context: .
|
||||
target: api
|
||||
70
.github/workflows/app_build.yaml
vendored
70
.github/workflows/app_build.yaml
vendored
@@ -1,70 +0,0 @@
|
||||
name: 'App Build'
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
environment_name:
|
||||
required: true
|
||||
type: string
|
||||
version_number:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
VITE_API_URL: ${{ vars.VITE_API_URL }}
|
||||
VITE_CLIENT_ID: ${{ vars.VITE_CLIENT_ID }}
|
||||
VITE_TENANT_ID: ${{ vars.VITE_TENANT_ID }}
|
||||
VITE_REDIRECT_URL: ${{ vars.VITE_REDIRECT_URL }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ inputs.environment_name }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
app
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
name: Install pnpm
|
||||
with:
|
||||
version: 10
|
||||
run_install: false
|
||||
|
||||
- name: 'Setup Node'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ vars.NODE_VERSION }}
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
pnpm install
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
pnpm --filter app build
|
||||
|
||||
- name: Deploy
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
run: |
|
||||
pnpm --filter app --prod deploy ./.prod/app
|
||||
|
||||
- name: Setup Docker Buildx
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log into Docker Hub
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push to registry
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: noahspan/flying-app:${{ inputs.version_number }}
|
||||
context: .
|
||||
target: app
|
||||
37
.github/workflows/main.yaml
vendored
37
.github/workflows/main.yaml
vendored
@@ -8,48 +8,25 @@ jobs:
|
||||
changes:
|
||||
uses: ./.github/workflows/changes.yaml
|
||||
|
||||
build-api:
|
||||
if: ${{ needs.changes.outputs.api == 'true' }}
|
||||
name: build-api
|
||||
needs:
|
||||
- changes
|
||||
uses: ./.github/workflows/api_build.yaml
|
||||
with:
|
||||
environment_name: test
|
||||
version_number: ${{ github.run_id }}
|
||||
secrets: inherit
|
||||
|
||||
deploy-api:
|
||||
name: deploy-api
|
||||
needs:
|
||||
- changes
|
||||
- build-api
|
||||
uses: ./.github/workflows/deploy.yaml
|
||||
with:
|
||||
app_name: flying-api
|
||||
environment_name: test
|
||||
version_number: ${{ github.run_id }}
|
||||
secrets: inherit
|
||||
|
||||
build-app:
|
||||
build:
|
||||
if: ${{ needs.changes.outputs.app == 'true' }}
|
||||
name: build-app
|
||||
name: build
|
||||
needs:
|
||||
- changes
|
||||
uses: ./.github/workflows/app_build.yaml
|
||||
uses: ./.github/workflows/build.yaml
|
||||
with:
|
||||
environment_name: test
|
||||
version_number: ${{ github.run_id }}
|
||||
secrets: inherit
|
||||
|
||||
deploy-app:
|
||||
name: deploy-app
|
||||
deploy:
|
||||
name: deploy
|
||||
needs:
|
||||
- changes
|
||||
- build-app
|
||||
- build
|
||||
uses: ./.github/workflows/deploy.yaml
|
||||
with:
|
||||
app_name: flying-app
|
||||
app_name: flying
|
||||
environment_name: test
|
||||
version_number: ${{ github.run_id }}
|
||||
secrets: inherit
|
||||
|
||||
33
.github/workflows/tag.yaml
vendored
33
.github/workflows/tag.yaml
vendored
@@ -5,40 +5,21 @@ on:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
|
||||
jobs:
|
||||
build-api:
|
||||
name: build-api
|
||||
uses: ./.github/workflows/api_build.yaml
|
||||
build:
|
||||
name: build
|
||||
uses: ./.github/workflows/build.yaml
|
||||
with:
|
||||
environment_name: prod
|
||||
version_number: ${{ github.ref_name }}
|
||||
secrets: inherit
|
||||
|
||||
deploy-api:
|
||||
name: deploy-api
|
||||
deploy:
|
||||
name: deploy
|
||||
needs:
|
||||
- build-api
|
||||
- build
|
||||
uses: ./.github/workflows/deploy.yaml
|
||||
with:
|
||||
app_name: flying-api
|
||||
environment_name: prod
|
||||
version_number: ${{ github.ref_name }}
|
||||
secrets: inherit
|
||||
|
||||
build-app:
|
||||
name: build-app
|
||||
uses: ./.github/workflows/app_build.yaml
|
||||
with:
|
||||
environment_name: prod
|
||||
version_number: ${{ github.ref_name }}
|
||||
secrets: inherit
|
||||
|
||||
deploy-app:
|
||||
name: deploy-app
|
||||
needs:
|
||||
- build-app
|
||||
uses: ./.github/workflows/deploy.yaml
|
||||
with:
|
||||
app_name: flying-app
|
||||
app_name: flying
|
||||
environment_name: prod
|
||||
version_number: ${{ github.ref_name }}
|
||||
secrets: inherit
|
||||
|
||||
Reference in New Issue
Block a user