Skip to content

Single js backend #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "npm"
directory: "/src"
schedule:
interval: "weekly"
- package-ecosystem: "terraform"
directory: "/terraform"
schedule:
interval: "weekly"
52 changes: 18 additions & 34 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ name: Tech Report API Pipeline
on: [push]

env:
PIPELINE_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
PIPELINE_SA_KEY: ${{ secrets.GCP_SA_KEY }}
PIPELINE_PROJECT_DATABASE_DEV: ${{ secrets.GCP_PROJECT_DATABASE_DEV }}
PIPELINE_PROJECT_DATABASE_PROD: ${{ secrets.GCP_PROJECT_DATABASE_PROD }}
PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS: ${{ secrets.GCP_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}
PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY: ${{ secrets.GCP_SERVICE_ACCOUNT_API_GATEWAY }}

Expand All @@ -15,18 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
- name: Test with pytest
run: |
python -m pytest -W "ignore"
- run: |
cd src
npm ci
npm run test

deploy_development:
if: github.ref == 'refs/heads/development'
Expand All @@ -40,30 +29,29 @@ jobs:
- name: Google Cloud Auth
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ env.PIPELINE_PROJECT_ID }}
project_id: 'httparchive'
credentials_json: ${{ env.PIPELINE_SA_KEY }}

- uses: hashicorp/setup-terraform@v3

- name: Terraform fmt
id: fmt
run: terraform fmt -check
continue-on-error: true

- name: Terraform Init
id: init
run: terraform init

- name: Terraform Validate
id: validate
run: terraform validate -no-color

- name: Terraform Plan
id: plan
run: |
terraform plan -no-color -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_DEV }}"
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}"
continue-on-error: true

- name: Terraform Plan status
Expand All @@ -75,9 +63,8 @@ jobs:
run: |
terraform apply -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_DEV }}" \
-auto-approve

deploy_production:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
Expand All @@ -90,30 +77,29 @@ jobs:
- name: Google Cloud Auth
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ env.PIPELINE_PROJECT_ID }}
project_id: 'httparchive'
credentials_json: ${{ env.PIPELINE_SA_KEY }}

- uses: hashicorp/setup-terraform@v3

- name: Terraform fmt
id: fmt
run: terraform fmt -check
continue-on-error: true

- name: Terraform Init
id: init
run: terraform init

- name: Terraform Validate
id: validate
run: terraform validate -no-color

- name: Terraform Plan
id: plan
run: |
terraform plan -no-color -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_PROD }}"
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}"
continue-on-error: true

- name: Terraform Plan status
Expand All @@ -125,7 +111,5 @@ jobs:
run: |
terraform apply -var="google_service_account_cloud_functions=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_CLOUD_FUNCTIONS }}" \
-var="google_service_account_api_gateway=${{ env.PIPELINE_GOOGLE_SERVICE_ACCOUNT_API_GATEWAY }}" \
-var="project_database=${{ env.PIPELINE_PROJECT_DATABASE_PROD }}" \
-auto-approve



11 changes: 2 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ spec.yaml
# CLI
.DS_Store

# asdf
/.tool-versions

# python
__pycache__
.pytest_cache
.venv

utils.txt
logs
node_modules/
src/coverage/
Loading
Loading