diff --git a/.DS_Store b/.DS_Store index dc31f0f..23b4337 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitea/workflows/build_and_test.yaml b/.gitea/workflows/build_and_test.yaml index fea054e..95b170d 100644 --- a/.gitea/workflows/build_and_test.yaml +++ b/.gitea/workflows/build_and_test.yaml @@ -21,6 +21,16 @@ jobs: api client + - name: Get Secrets from Infisical + uses: Infisical/secrets-action@v1.0.16 + with: + domain: "https://secrets.noahspan.me" + client-id: ${{ secrets.INFISICAL_CLIENT_ID }} + client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }} + project-slug: noahspan-8t6-z + env-slug: ${{ inputs.environment_name }} + secret-path: /flying + - name: Install Nest CLI run: | npm install -g @nestjs/cli @@ -28,7 +38,7 @@ jobs: - name: 'Setup Node' uses: actions/setup-node@v4 with: - node-version: ${{ vars.NODE_VERSION }} + node-version: ${{ env.NODE_VERSION }} - name: Install dependencies run: | @@ -44,11 +54,11 @@ jobs: - name: Build Client env: - VITE_API_URL: ${{ vars.VITE_API_URL }} - VITE_BASE_URL: ${{ inputs.environment_name == 'test' && vars.VITE_BASE_URL_TEST || vars.VITE_BASE_URL_PROD }} - VITE_CLIENT_ID: ${{ inputs.environment_name == 'test' && vars.VITE_CLIENT_ID_TEST || vars.VITE_CLIENT_ID_PROD }} - VITE_ISSUER_URI: ${{ vars.VITE_ISSUER_URI }} - VITE_TENANT_ID: ${{ vars.VITE_TENANT_ID }} + VITE_API_URL: ${{ env.VITE_API_URL }} + VITE_BASE_URL: ${{ env.VITE_BASE_URL }} + VITE_CLIENT_ID: ${{ env.VITE_CLIENT_ID }} + VITE_ISSUER_URI: ${{ env.VITE_ISSUER_URI }} + VITE_TENANT_ID: ${{ env.VITE_TENANT_ID }} run: | printenv npm run build -w client @@ -57,8 +67,8 @@ jobs: if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v3 with: - username: ${{ vars.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ env.DOCKERHUB_TOKEN }} - name: Setup Docker Buildx if: ${{ github.event_name != 'pull_request' }} diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 235edca..335660f 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -21,14 +21,24 @@ jobs: runs-on: ubuntu-latest environment: ${{ inputs.environment_name }} steps: + - name: Get Secrets from Infisical + uses: Infisical/secrets-action@v1.0.16 + with: + domain: "https://secrets.noahspan.me" + client-id: ${{ secrets.INFISICAL_CLIENT_ID }} + client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }} + project-slug: noahspan-8t6-z + env-slug: ${{ inputs.environment_name }} + secret-path: /flying + - name: Install Azure CLI run: | curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - name: Log in to Azure 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 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 }} \ No newline at end of file + 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 }} \ No newline at end of file diff --git a/.gitea/workflows/infrastructure.yaml b/.gitea/workflows/infrastructure.yaml new file mode 100644 index 0000000..3fc5c49 --- /dev/null +++ b/.gitea/workflows/infrastructure.yaml @@ -0,0 +1,43 @@ +name: 'Infrastructure' +on: + workflow_dispatch: + inputs: + environment_name: + type: string + +jobs: + infrastructure: + 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: "https://secrets.noahspan.me" + client-id: ${{ secrets.INFISICAL_CLIENT_ID }} + client-secret: ${{ secrets.INFISICAL_CLIENT_SECRET }} + project-slug: noahspan-8t6-z + env-slug: ${{ inputs.environment_name }} + secret-path: /flying/terraform + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v4 + + - name: Terraform init + uses: | + terraform init -input=false + + - name: Terraform plan + uses: | + terraform plan -no-color -input=false + + - name: Terraform apply + uses: | + terraform apply -no-color - + \ No newline at end of file diff --git a/README.md b/README.md index f2824a3..cba97c3 100644 --- a/README.md +++ b/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 diff --git a/client/src/components/logbook/Logbook.tsx b/client/src/components/logbook/Logbook.tsx index 2e6606c..3d1e71c 100644 --- a/client/src/components/logbook/Logbook.tsx +++ b/client/src/components/logbook/Logbook.tsx @@ -561,7 +561,7 @@ const Logbook: React.FC = () => { )} {!state.isLoading && state.entries.length > 0 && screenSize !== ScreenSize.SM && screenSize !== ScreenSize.MD && ( -
+