renaming .github to .gitea
This commit is contained in:
73
gitea/workflows/build_and_test.yaml
Normal file
73
gitea/workflows/build_and_test.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
name: 'API Build'
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
environment_name:
|
||||
required: true
|
||||
type: string
|
||||
version_number:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ inputs.environment_name }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
sparse-checkout: |
|
||||
api
|
||||
client
|
||||
|
||||
- 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 API
|
||||
run: |
|
||||
npm run build -w api
|
||||
|
||||
- name: Test API
|
||||
run: |
|
||||
npm run test -w api
|
||||
|
||||
- name: Build Client
|
||||
env:
|
||||
VITE_API_URL: ${{ vars.VITE_API_URL }}
|
||||
VITE_BASE_URL: ${{ vars.VITE_BASE_URL }}
|
||||
VITE_CLIENT_ID: ${{ vars.VITE_CLIENT_ID }}
|
||||
VITE_ISSUER_URI: ${{ vars.VITE_ISSUER_URI }}
|
||||
VITE_TENANT_ID: ${{ vars.VITE_TENANT_ID }}
|
||||
run: |
|
||||
printenv
|
||||
npm run build -w client
|
||||
|
||||
- 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:${{ inputs.version_number }}
|
||||
context: .
|
||||
27
gitea/workflows/changes.yaml
Normal file
27
gitea/workflows/changes.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Changes
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
api:
|
||||
value: ${{ jobs.changes.outputs.api }}
|
||||
client:
|
||||
value: ${{ jobs.changes.outputs.client }}
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
name: filter
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
api: ${{ steps.filter.outputs.api }}
|
||||
client: ${{ steps.filter.outputs.client }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
api:
|
||||
- 'api/**'
|
||||
client:
|
||||
- 'client/**'
|
||||
35
gitea/workflows/deploy.yaml
Normal file
35
gitea/workflows/deploy.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Deploy
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
app_name:
|
||||
required: true
|
||||
type: string
|
||||
environment_name:
|
||||
required: true
|
||||
type: string
|
||||
version_number:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ inputs.environment_name }}
|
||||
steps:
|
||||
- name: Log in to Azure
|
||||
uses: azure/login@v2
|
||||
with:
|
||||
client-id: ${{ vars.AZURE_CLIENT_ID }}
|
||||
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
||||
tenant-id: ${{ vars.AZURE_TENANT_ID }}
|
||||
|
||||
- name: Azure CLI script
|
||||
uses: azure/cli@v2
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |
|
||||
az containerapp update --name ${{ inputs.app_name }}-${{ inputs.environment_name }} --container-name ${{ inputs.app_name }} --resource-group noahspan --image docker.io/noahspan/${{ inputs.app_name }}:${{ inputs.version_number }}
|
||||
32
gitea/workflows/main.yaml
Normal file
32
gitea/workflows/main.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Main
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
uses: ./.github/workflows/changes.yaml
|
||||
|
||||
build:
|
||||
if: ${{ needs.changes.outputs.api == 'true' || needs.changes.outputs.client == 'true' }}
|
||||
name: build
|
||||
needs:
|
||||
- changes
|
||||
uses: ./.github/workflows/build_and_test.yaml
|
||||
with:
|
||||
environment_name: test
|
||||
version_number: ${{ github.run_id }}
|
||||
secrets: inherit
|
||||
|
||||
deploy:
|
||||
name: deploy
|
||||
needs:
|
||||
- changes
|
||||
- build
|
||||
uses: ./.github/workflows/deploy.yaml
|
||||
with:
|
||||
app_name: flying
|
||||
environment_name: test
|
||||
version_number: ${{ github.run_id }}
|
||||
secrets: inherit
|
||||
19
gitea/workflows/pull_request.yaml
Normal file
19
gitea/workflows/pull_request.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Pull Request
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
uses: ./.github/workflows/changes.yaml
|
||||
|
||||
build:
|
||||
if: ${{ needs.changes.outputs.app == 'true' || needs.changes.outputs.client == 'true'}}
|
||||
name: build
|
||||
needs:
|
||||
- changes
|
||||
uses: ./.github/workflows/build_and_test.yaml
|
||||
with:
|
||||
environment_name: pull_request
|
||||
version_number: ${{ github.run_id }}
|
||||
secrets: inherit
|
||||
25
gitea/workflows/tag.yaml
Normal file
25
gitea/workflows/tag.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Tag
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build
|
||||
uses: ./.github/workflows/build_and_test.yaml
|
||||
with:
|
||||
environment_name: prod
|
||||
version_number: ${{ github.ref_name }}
|
||||
secrets: inherit
|
||||
|
||||
deploy:
|
||||
name: deploy
|
||||
needs:
|
||||
- build
|
||||
uses: ./.github/workflows/deploy.yaml
|
||||
with:
|
||||
app_name: flying
|
||||
environment_name: prod
|
||||
version_number: ${{ github.ref_name }}
|
||||
secrets: inherit
|
||||
Reference in New Issue
Block a user