-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec44d1b
commit 2c184c5
Showing
10 changed files
with
563 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
commit-message: | ||
prefix: "bump(deps): " | ||
|
||
- package-ecosystem: docker | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
commit-message: | ||
prefix: "bump(docker) " | ||
|
||
- package-ecosystem: github-actions | ||
directory: /.github/workflows | ||
schedule: | ||
interval: monthly | ||
commit-message: | ||
prefix: "bump(actions) " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Deploy to dev | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled] | ||
paths: | ||
- '**.js*' | ||
- '**.ts*' | ||
- Dockerfile | ||
- package.json | ||
- pnpm-lock.yaml | ||
- .github/workflows/cd-deploy-to-dev.yml | ||
- .github/workflows/sub-cloudrun-deploy.yml | ||
|
||
concurrency: | ||
# Ensures that only one workflow task will run at a time. Previous builds, if | ||
# already in process, will get cancelled. Only the latest commit will be allowed | ||
# to run, cancelling any workflows in between | ||
group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/sub-unit-tests.yml | ||
with: | ||
node_env: development | ||
|
||
build: | ||
uses: ./.github/workflows/sub-build-docker-image.yml | ||
with: | ||
environment: dev | ||
dockerfile_path: ./docker/Dockerfile | ||
dockerfile_target: runner | ||
app_name: ${{ vars.APP_NAME }} | ||
registry: ${{ vars.GAR_BASE }} | ||
secrets: inherit | ||
|
||
deploy: | ||
needs: [build] | ||
uses: ./.github/workflows/sub-cloudrun-deploy.yml | ||
with: | ||
environment: dev | ||
project_id: ${{ vars.GCP_PROJECT }} | ||
region: ${{ vars.GCP_REGION }} | ||
app_name: ${{ vars.APP_NAME }} | ||
registry: ${{ vars.GAR_BASE }} | ||
image_digest: ${{ needs.build.outputs.image_digest }} | ||
min_instances: '0' | ||
max_instances: '30' | ||
cpu: '1' | ||
memory: 1Gi | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Deploy to prod | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
concurrency: | ||
# Ensures that only one workflow task will run at a time. Previous builds, if | ||
# already in process, will get cancelled. Only the latest commit will be allowed | ||
# to run, cancelling any workflows in between | ||
group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/sub-unit-tests.yml | ||
with: | ||
node_env: production | ||
|
||
build: | ||
# needs: [test] | ||
uses: ./.github/workflows/sub-build-docker-image.yml | ||
with: | ||
environment: prod | ||
dockerfile_path: ./docker/Dockerfile | ||
dockerfile_target: runner | ||
app_name: ${{ vars.APP_NAME }} | ||
registry: ${{ vars.GAR_BASE }} | ||
secrets: inherit | ||
|
||
deploy: | ||
needs: [build] | ||
uses: ./.github/workflows/sub-cloudrun-deploy.yml | ||
with: | ||
environment: prod | ||
project_id: ${{ vars.GCP_PROJECT }} | ||
region: ${{ vars.GCP_REGION }} | ||
app_name: ${{ vars.APP_NAME }} | ||
registry: ${{ vars.GAR_BASE }} | ||
image_digest: ${{ needs.build.outputs.image_digest }} | ||
min_instances: '1' | ||
max_instances: '100' | ||
cpu: '1' | ||
memory: 1Gi | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Deploy to test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**.js*' | ||
- '**.ts*' | ||
- Dockerfile | ||
- package.json | ||
- pnpm-lock.yaml | ||
- .github/workflows/cd-deploy-to-test.yml | ||
- .github/workflows/sub-cloudrun-deploy.yml | ||
|
||
concurrency: | ||
# Ensures that only one workflow task will run at a time. Previous builds, if | ||
# already in process, will get cancelled. Only the latest commit will be allowed | ||
# to run, cancelling any workflows in between | ||
group: ${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/sub-unit-tests.yml | ||
with: | ||
node_env: production | ||
|
||
build: | ||
needs: [test] | ||
uses: ./.github/workflows/sub-build-docker-image.yml | ||
with: | ||
environment: test | ||
dockerfile_path: ./docker/Dockerfile | ||
dockerfile_target: runner | ||
app_name: ${{ vars.APP_NAME }} | ||
registry: ${{ vars.GAR_BASE }} | ||
secrets: inherit | ||
|
||
deploy: | ||
needs: [build] | ||
uses: ./.github/workflows/sub-cloudrun-deploy.yml | ||
with: | ||
environment: test | ||
project_id: ${{ vars.GCP_PROJECT }} | ||
region: ${{ vars.GCP_REGION }} | ||
app_name: ${{ vars.APP_NAME }} | ||
registry: ${{ vars.GAR_BASE }} | ||
image_digest: ${{ needs.build.outputs.image_digest }} | ||
min_instances: '0' | ||
max_instances: '30' | ||
cpu: '1' | ||
memory: 1Gi | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Clean dev instances | ||
|
||
on: | ||
delete: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
|
||
jobs: | ||
delete: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Inject slug/short variables | ||
uses: rlespinasse/[email protected] | ||
|
||
- name: Authenticate to Google Cloud | ||
id: auth | ||
uses: google-github-actions/[email protected] | ||
with: | ||
workload_identity_provider: '${{ vars.GCP_WIF }}' | ||
service_account: '${{ vars.GCP_DEPLOYMENTS_SA }}' | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/[email protected] | ||
|
||
- name: Removing CR service | ||
run: | | ||
gcloud run services delete ${{ vars.APP_NAME }}-${{ env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }} --region=${{ vars.GOOGLE_CLOUD_REGION }} --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Lint Code Base | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
paths-ignore: | ||
- '**.js*' | ||
- '**.ts*' | ||
- Dockerfile | ||
- package.json | ||
- pnpm-lock.yaml | ||
- .github/workflows/ci-lint-codebase.yml | ||
|
||
jobs: | ||
linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "Job not required" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Lint Code Base | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- '**.js*' | ||
- '**.ts*' | ||
- Dockerfile | ||
- package.json | ||
- pnpm-lock.yaml | ||
- .github/workflows/ci-lint-codebase.yml | ||
|
||
push: | ||
branches: [main] | ||
paths: | ||
- '**.js*' | ||
- '**.ts*' | ||
- Dockerfile | ||
- package.json | ||
- pnpm-lock.yaml | ||
- .github/workflows/ci-lint-codebase.yml | ||
|
||
concurrency: | ||
# Ensures that only one workflow task will run at a time. Previous builds, if | ||
# already in process, will get cancelled. Only the latest commit will be allowed | ||
# to run, cancelling any workflows in between | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code Repository | ||
uses: actions/[email protected] | ||
with: | ||
# Full git history is needed to get a proper | ||
# list of changed files within `super-linter` | ||
fetch-depth: 0 | ||
|
||
- name: Lint Code Base | ||
uses: super-linter/super-linter/[email protected] | ||
env: | ||
LOG_LEVEL: ERROR | ||
VALIDATE_ALL_CODEBASE: false | ||
VALIDATE_SHELL_SHFMT: false | ||
VALIDATE_JSCPD: false | ||
VALIDATE_CSS: false | ||
VALIDATE_EDITORCONFIG: false | ||
VALIDATE_MARKDOWN: false | ||
VALIDATE_DOCKERFILE_HADOLINT: false | ||
LINTER_RULES_PATH: / | ||
JAVASCRIPT_DEFAULT_STYLE: prettier | ||
TYPESCRIPT_DEFAULT_STYLE: prettier | ||
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.