Skip to content
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

Github actions enhancements - streamlining workflows, workflow deploy automation, configuration refactoring, and bug Fixes #547

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
063854d
[#436] Implement a generic target to create a directory structure for…
placek Mar 13, 2024
fe3b9ed
[#436] Refactor the `prepare-nginx-config` phony target
placek Mar 13, 2024
ce340bd
[#436] Refactor the prepare-loki-config target
placek Mar 13, 2024
bb26750
[#436] Refactor prepare-promtail-config target
placek Mar 13, 2024
56f8424
[#436] Refactor the `prepare-prometheus-config` target
placek Mar 13, 2024
a5f48dc
[#436] Refactor `prepare-backend-config` target
placek Mar 14, 2024
e721856
[#436] Refactor target configuration in `config.mk` to include `govto…
placek Mar 14, 2024
e9c6f1f
[#436] Refactor deployment makefiles to use file targets instead of p…
placek Mar 14, 2024
54e98b0
[#436] Refactor prepare-dbsync-secrets target
placek Mar 14, 2024
56799b4
[#436] Refactor generate-docker-compose-file target
placek Mar 14, 2024
c48917c
[#436] Refactor backend-config generation to use a template file targ…
placek Mar 14, 2024
88efcc4
[#436] Remove phony Cardano config targets with actual file targets
placek Mar 14, 2024
8b6c111
[#436] Refactor deployment makefiles to use file targets instead of p…
placek Mar 14, 2024
3b193e3
[#436] Change explicit file targets to a more generic target
placek Mar 14, 2024
6ac45d4
[#436] Refactor grafana provisioning target
placek Mar 14, 2024
3edc22f
[#436] Refactor usage of `directories` variable for improved structuring
placek Mar 14, 2024
93e9c69
[#484] Add GitHub Action workflow to automate deployment to the test …
placek Mar 15, 2024
4e2db9e
[#484] Add GitHub Action workflow to automate deployment to the stagi…
placek Mar 15, 2024
c457395
[#484] Add GitHub Action workflow to automate deployment to the beta …
placek Mar 15, 2024
3a8c191
[#484] Add manually triggered workflow for resyncing the Cardano stat…
placek Mar 15, 2024
784b1a3
[#436] Refactor configuration output list
placek Mar 14, 2024
27c1f35
[#436] Remove the invalid phony statement
placek Mar 14, 2024
4bf7569
[#436] Move the upload target to the top to expose it more
placek Mar 14, 2024
97ad6c0
Merge pull request #470 from IntersectMBO/chore/436-refactor-deployme…
placek Mar 18, 2024
89f6298
[#444] Refactor maintenance mode workflow
placek Mar 15, 2024
b647323
Merge pull request #486 from IntersectMBO/chore/444-simplifying-toggl…
placek Mar 18, 2024
43b24a7
[#484] Restrict manual deployment to the dev server only
placek Mar 15, 2024
efd1556
[#501] fix sql error
jankun4 Mar 18, 2024
b4d5557
[#503] Parametrize the configuration files for PostgreSQL with ENVs
placek Mar 19, 2024
223679b
[#503] Update Cardano DB Sync version to 4.1.0
placek Mar 19, 2024
8a98945
Merge pull request #485 from IntersectMBO/feat/484-implement-github-a…
placek Mar 19, 2024
59adf03
[#457] Enable skipping Basic Auth for connections from VPN
placek Mar 14, 2024
dc2df5f
[#457] Add VPN addresses as environment variables for Basic Auth bypass
placek Mar 14, 2024
6eb66d1
Merge pull request #477 from IntersectMBO/feat/457-enable-skip-basic-…
placek Mar 19, 2024
d472d90
[#507] chore: add frontend test github workflow
MSzalowski Mar 19, 2024
4cda470
[#507] chore: change file name
MSzalowski Mar 19, 2024
ffd1129
Merge pull request #508 from IntersectMBO/feat/507/add-frontend-packa…
MSzalowski Mar 19, 2024
8e2a082
Merge pull request #504 from IntersectMBO/chore/503-update-cardano-db…
placek Mar 20, 2024
28ef369
[#512] chore: add type checking & lint workflow to github actions
MSzalowski Mar 19, 2024
5dd8ccc
[#512] chore: join test & code check workflows into one
MSzalowski Mar 19, 2024
e3d7805
[#512] chore: set .nvmrc as node version source
MSzalowski Mar 19, 2024
0284628
[#512] chore: split jobs to work in parallel; add emoji to label actions
MSzalowski Mar 19, 2024
7a5d234
[#512] chore: fix tsc execution
MSzalowski Mar 19, 2024
e8d30fb
Merge pull request #515 from IntersectMBO/develop
pmbinapps Mar 20, 2024
f4143f0
[#516] Update deployment workflows to include missing variables
placek Mar 20, 2024
3d2b76d
Merge pull request #517 from IntersectMBO/fix/516-resolving-deploymen…
placek Mar 20, 2024
c9e8c54
Merge pull request #513 from IntersectMBO/chore/512-add-eslint-tsc-an…
MSzalowski Mar 20, 2024
5a4c24a
[#166] chore: add eslint & prettier configuration
MSzalowski Mar 19, 2024
b0c57b0
[#166] chore: enforce arrow component functions; disable obsolete or …
MSzalowski Mar 20, 2024
28e9799
Merge pull request #511 from IntersectMBO/chore/166-integrate-eslint-…
MSzalowski Mar 20, 2024
ee6d34e
chore: cleanup ga submission code
MSzalowski Mar 18, 2024
4b95651
Merge pull request #499 from IntersectMBO/chore/ga-submission-code-cl…
MSzalowski Mar 20, 2024
2e400d6
update CSL
Sworzen1 Mar 20, 2024
7adca4a
npm / yarn
Sworzen1 Mar 20, 2024
4c53e16
move CSL into dependencies/ patch CSL pacakge
Sworzen1 Mar 20, 2024
7e2d0b3
delete unnecessary files
Sworzen1 Mar 20, 2024
3006b56
add info to changelog
Sworzen1 Mar 20, 2024
68df326
Merge pull request #520 from IntersectMBO/chore/update-CSL-to-19
Sworzen1 Mar 20, 2024
f139020
Merge pull request #518 from IntersectMBO/develop
pmbinapps Mar 20, 2024
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
66 changes: 66 additions & 0 deletions .github/workflows/build-and-deploy-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and deploy GovTool to BETA server
run-name: Deploy by @${{ github.actor }}

on:
push:
branches:
- main

env:
ENVIRONMENT: "beta"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "sanchogov.tools"

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/govtool
env:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
GTM_ID: ${{ secrets.GTM_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }}
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Login to AWS ECR
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1

- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }}

- name: Deploy app
run: |
make --debug=b all

- name: Reprovision Grafana
run: |
sleep 30 # give grafana time to start up
make --debug=b reload-grafana
64 changes: 64 additions & 0 deletions .github/workflows/build-and-deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and deploy GovTool to DEV server
run-name: Deploy by @${{ github.actor }}

on:
workflow_dispatch:

env:
ENVIRONMENT: "dev"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "dev-sanchonet.govtool.byron.network"

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/govtool
env:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
GTM_ID: ${{ secrets.GTM_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }}
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Login to AWS ECR
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1

- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }}

- name: Deploy app
run: |
make --debug=b all

- name: Reprovision Grafana
run: |
sleep 30 # give grafana time to start up
make --debug=b reload-grafana
66 changes: 66 additions & 0 deletions .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and deploy GovTool to STAGING server
run-name: Deploy by @${{ github.actor }}

on:
push:
branches:
- staging

env:
ENVIRONMENT: "staging"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "staging.govtool.byron.network"

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/govtool
env:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
GTM_ID: ${{ secrets.GTM_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }}
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Login to AWS ECR
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1

- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }}

- name: Deploy app
run: |
make --debug=b all

- name: Reprovision Grafana
run: |
sleep 30 # give grafana time to start up
make --debug=b reload-grafana
66 changes: 66 additions & 0 deletions .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and deploy GovTool to TEST server
run-name: Deploy by @${{ github.actor }}

on:
push:
branches:
- test

env:
ENVIRONMENT: "test"
CARDANO_NETWORK: "sanchonet"
DOMAIN: "test-sanchonet.govtool.byron.network"

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/govtool
env:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
GTM_ID: ${{ secrets.GTM_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }}
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.GHA_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.GHA_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Login to AWS ECR
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1

- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.GHA_SSH_PRIVATE_KEY }}

- name: Deploy app
run: |
make --debug=b all

- name: Reprovision Grafana
run: |
sleep 30 # give grafana time to start up
make --debug=b reload-grafana
78 changes: 78 additions & 0 deletions .github/workflows/code_check_frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Frontend Test, Lint & Type Check
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already fixed on development. I would not push it to staging now

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, we can pull this first from dev to test, verify and then proceed to stage.


on:
push:
paths:
- govtool/frontend/**
- .github/workflows/test_frontend.yml

defaults:
run:
working-directory: govtool/frontend

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
with:
path: govtool/frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('govtool/frontend/package-lock.json') }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: "govtool/frontend/.nvmrc"

- name: 🧪 Test
run: |
npm install
npm run test

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
with:
path: govtool/frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('govtool/frontend/package-lock.json') }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: "govtool/frontend/.nvmrc"

- name: 👕 Lint
run: /
npm install
npm run lint

type_check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v2
with:
path: govtool/frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('govtool/frontend/package-lock.json') }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: "govtool/frontend/.nvmrc"

- name: 🔍 Type Check
run: /
npm install
npm run tsc
Loading
Loading