Compare commits
18 Commits
v2.1.5
...
4eccf8e83c
| Author | SHA1 | Date | |
|---|---|---|---|
| 4eccf8e83c | |||
| a4778d29be | |||
| 5c04870d37 | |||
| c81b514ae8 | |||
| 5a07318527 | |||
| 99e5d162ef | |||
| 755c429d04 | |||
| 6ea7326a57 | |||
| e3f385d0a4 | |||
| f33a9982cc | |||
| 100fd78551 | |||
| a87d35a5e4 | |||
| 0c4fe29553 | |||
| 03c4dacd99 | |||
| 1ed1a6c48a | |||
| 4c77ebc1d6 | |||
| 650ea704aa | |||
| d51e95f59e |
@@ -21,6 +21,16 @@ jobs:
|
|||||||
api
|
api
|
||||||
client
|
client
|
||||||
|
|
||||||
|
- name: Get Secrets from Infisical
|
||||||
|
uses: Infisical/secrets-action@v1.0.16
|
||||||
|
with:
|
||||||
|
domain: ${{ secrets.INFISICAL_DOMAIN }}
|
||||||
|
client-id: ${{ secrets.INFISICAL_CLIENT_ID }}
|
||||||
|
client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
|
||||||
|
project-slug: ${{ secrets.INFISICAL_PROJECT_SLUG }}
|
||||||
|
env-slug: ${{ inputs.environment_name }}
|
||||||
|
secret-path: /flying
|
||||||
|
|
||||||
- name: Install Nest CLI
|
- name: Install Nest CLI
|
||||||
run: |
|
run: |
|
||||||
npm install -g @nestjs/cli
|
npm install -g @nestjs/cli
|
||||||
@@ -28,7 +38,7 @@ jobs:
|
|||||||
- name: 'Setup Node'
|
- name: 'Setup Node'
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ vars.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -44,21 +54,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Client
|
- name: Build Client
|
||||||
env:
|
env:
|
||||||
VITE_API_URL: ${{ vars.VITE_API_URL }}
|
VITE_API_URL: ${{ env.VITE_API_URL }}
|
||||||
VITE_BASE_URL: ${{ inputs.environment_name == 'test' && vars.VITE_BASE_URL_TEST || vars.VITE_BASE_URL_PROD }}
|
VITE_BASE_URL: ${{ env.VITE_BASE_URL }}
|
||||||
VITE_CLIENT_ID: ${{ inputs.environment_name == 'test' && vars.VITE_CLIENT_ID_TEST || vars.VITE_CLIENT_ID_PROD }}
|
VITE_CLIENT_ID: ${{ env.VITE_CLIENT_ID }}
|
||||||
VITE_ISSUER_URI: ${{ vars.VITE_ISSUER_URI }}
|
VITE_ISSUER_URI: ${{ env.VITE_ISSUER_URI }}
|
||||||
VITE_TENANT_ID: ${{ vars.VITE_TENANT_ID }}
|
VITE_TENANT_ID: ${{ env.VITE_TENANT_ID }}
|
||||||
run: |
|
run: |
|
||||||
printenv
|
|
||||||
npm run build -w client
|
npm run build -w client
|
||||||
|
|
||||||
- name: Log into Docker Hub
|
- name: Log into Docker Hub
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
username: ${{ env.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ env.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Setup Docker Buildx
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
|
|||||||
@@ -34,3 +34,5 @@ jobs:
|
|||||||
- 'api/**'
|
- 'api/**'
|
||||||
client:
|
client:
|
||||||
- 'client/**'
|
- 'client/**'
|
||||||
|
infrastructure:
|
||||||
|
- 'infrastructure/**'
|
||||||
@@ -21,14 +21,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: ${{ inputs.environment_name }}
|
environment: ${{ inputs.environment_name }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Get Secrets from Infisical
|
||||||
|
uses: Infisical/secrets-action@v1.0.16
|
||||||
|
with:
|
||||||
|
domain: ${{ secrets.INFISICAL_DOMAIN }}
|
||||||
|
client-id: ${{ secrets.INFISICAL_CLIENT_ID }}
|
||||||
|
client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
|
||||||
|
project-slug: ${{ secrets.INFISICAL_PROJECT_SLUG }}
|
||||||
|
env-slug: ${{ inputs.environment_name }}
|
||||||
|
secret-path: /flying
|
||||||
|
|
||||||
- name: Install Azure CLI
|
- name: Install Azure CLI
|
||||||
run: |
|
run: |
|
||||||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
||||||
|
|
||||||
- name: Log in to Azure
|
- name: Log in to Azure
|
||||||
run: |
|
run: |
|
||||||
az login --service-principal --username ${{ vars.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ vars.AZURE_TENANT_ID }}
|
az login --service-principal --username ${{ env.AZURE_CLIENT_ID }} --password ${{ env.AZURE_CLIENT_SECRET }} --tenant ${{ env.AZURE_TENANT_ID }}
|
||||||
|
|
||||||
- name: Update Container App
|
- name: Update Container App
|
||||||
run: |
|
run: |
|
||||||
az containerapp update --name ${{ inputs.app_name }}-${{ inputs.environment_name }} --container-name ${{ inputs.app_name }} --resource-group ${{ vars.RESOURCE_GROUP }} --image docker.io/noahspan/${{ inputs.app_name }}:${{ inputs.version_number }}
|
az containerapp update --name ${{ inputs.app_name }}-${{ inputs.environment_name }} --container-name ${{ inputs.app_name }} --resource-group ${{ env.RESOURCE_GROUP }} --image docker.io/noahspan/${{ inputs.app_name }}:${{ inputs.version_number }}
|
||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
name: deploy
|
name: deploy
|
||||||
needs:
|
needs:
|
||||||
- changes
|
- changes
|
||||||
- build
|
- build-and-test
|
||||||
uses: ./.gitea/workflows/deploy.yaml
|
uses: ./.gitea/workflows/deploy.yaml
|
||||||
with:
|
with:
|
||||||
app_name: flying
|
app_name: flying
|
||||||
|
|||||||
@@ -14,6 +14,16 @@ jobs:
|
|||||||
- changes
|
- changes
|
||||||
uses: ./.gitea/workflows/build_and_test.yaml
|
uses: ./.gitea/workflows/build_and_test.yaml
|
||||||
with:
|
with:
|
||||||
environment_name: pull_request
|
environment_name: test
|
||||||
version_number: ${{ github.run_id }}
|
version_number: ${{ github.run_id }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
terraform:
|
||||||
|
if: ${{ needs.changes.outputs.infrastructure == 'true' }}
|
||||||
|
name: terraform-plan
|
||||||
|
needs:
|
||||||
|
- changes
|
||||||
|
uses: ./.gitea/workflows/infrastructure.yaml
|
||||||
|
with:
|
||||||
|
environment_name: test
|
||||||
|
secrets: inherit
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ on:
|
|||||||
- '**'
|
- '**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-and-test:
|
||||||
name: build
|
name: build-and-test
|
||||||
uses: ./.gitea/workflows/build_and_test.yaml
|
uses: ./.gitea/workflows/build_and_test.yaml
|
||||||
with:
|
with:
|
||||||
environment_name: prod
|
environment_name: prod
|
||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
name: deploy
|
name: deploy
|
||||||
needs:
|
needs:
|
||||||
- build
|
- build-and-test
|
||||||
uses: ./.gitea/workflows/deploy.yaml
|
uses: ./.gitea/workflows/deploy.yaml
|
||||||
with:
|
with:
|
||||||
app_name: flying
|
app_name: flying
|
||||||
|
|||||||
45
.gitea/workflows/terraform.yaml
Normal file
45
.gitea/workflows/terraform.yaml
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: 'Terraform'
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
environment_name:
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
terraform:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
environment:
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
sparse-checkout: |
|
||||||
|
infrastructure
|
||||||
|
|
||||||
|
- name: Get Secrets from Infisical
|
||||||
|
uses: Infisical/secrets-action@v1.0.16
|
||||||
|
with:
|
||||||
|
domain: ${{ secrets.INFISICAL_DOMAIN }}
|
||||||
|
client-id: ${{ secrets.INFISICAL_CLIENT_ID }}
|
||||||
|
client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
|
||||||
|
project-slug: ${{ secrets.INFISICAL_PROJECT_SLUG }}
|
||||||
|
env-slug: ${{ inputs.environment_name }}
|
||||||
|
secret-path: /flying/terraform
|
||||||
|
|
||||||
|
- name: Setup Terraform
|
||||||
|
uses: hashicorp/setup-terraform@v4
|
||||||
|
|
||||||
|
- name: Terraform init
|
||||||
|
run: |
|
||||||
|
terraform -chdir=./infrastructure init -input=false
|
||||||
|
|
||||||
|
- name: Terraform plan
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
run: |
|
||||||
|
terraform -chdir=./infrastructure plan -no-color -input=false
|
||||||
|
|
||||||
|
- name: Terraform apply
|
||||||
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
|
run: |
|
||||||
|
terraform -chdir=./infrastructure apply -no-color -input=false
|
||||||
|
|
||||||
24
README.md
24
README.md
@@ -1,3 +1,23 @@
|
|||||||
# Flying (React and NestJS)
|
# Flying
|
||||||
|
|
||||||
A pilot logbook app
|
A web app for tracking pilot flight hours and sharing flight tracks.
|
||||||
|
|
||||||
|
## Built With
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
## Roadmap
|
||||||
|
|
||||||
|
- [ ] Expense tracking for plane rental, instructor fees, and fuel rates
|
||||||
|
- [ ] Export logbook to CSV
|
||||||
|
- [ ]
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
|||||||
@@ -9,9 +9,24 @@ services:
|
|||||||
- '10001:10001'
|
- '10001:10001'
|
||||||
- '10002:10002'
|
- '10002:10002'
|
||||||
command: 'azurite --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 --loose --skipApiVersionCheck'
|
command: 'azurite --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 --loose --skipApiVersionCheck'
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-z", "127.0.0.1", "10000"]
|
||||||
volumes:
|
volumes:
|
||||||
- ./azurite-data:/data
|
- ./azurite-data:/data
|
||||||
|
|
||||||
|
seed:
|
||||||
|
image: mcr.microsoft.com/azure-cli
|
||||||
|
depends_on:
|
||||||
|
azurite:
|
||||||
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- ./seed-data:/data
|
||||||
|
entrypoint: >
|
||||||
|
sh -c "
|
||||||
|
az storage container create --name mycontainer --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;' &&
|
||||||
|
az storage blob upload-batch --destination mycontainer --source /data --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;'
|
||||||
|
"
|
||||||
|
|
||||||
restore:
|
restore:
|
||||||
container_name: restore
|
container_name: restore
|
||||||
image: litestream/litestream:0.3.13
|
image: litestream/litestream:0.3.13
|
||||||
@@ -51,6 +66,7 @@ services:
|
|||||||
condition: service_started
|
condition: service_started
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
# azurite-data:
|
azurite-data:
|
||||||
backup:
|
backup:
|
||||||
data:
|
data:
|
||||||
|
seed-data:
|
||||||
Reference in New Issue
Block a user