Skip to content

Commit

Permalink
maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
GiridharRNair committed Oct 27, 2024
1 parent 458f8a5 commit 65d31f8
Show file tree
Hide file tree
Showing 9 changed files with 1,080 additions and 2,439 deletions.
115 changes: 57 additions & 58 deletions .github/workflows/chrome-web-store.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,62 @@
name: Deploy to Chrome Web Store

on:
push:
tags:
- '*'
push:
tags:
- "*"

jobs:
build-chrome-extension:
name: Build Chrome extension artifact
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3

- name: Install dependencies
run: npm install

- name: Build extension
run: |
npm run build
zip -r chrome-extension-${{ github.sha }}.zip dist
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}

- name: Archive chrome-extension artifact
uses: actions/upload-artifact@v2
with:
name: chrome-extension-${{ github.sha }}
path: chrome-extension-${{ github.sha }}.zip

upload-extension:
name: Upload Chrome extension artifact to Chrome Web Store
needs: build-chrome-extension
runs-on: ubuntu-latest
env:
EXTENSION_ID: doilmgfedjlpepeaolcfpdmkehecdaff

steps:
- name: Set up Node.js
uses: actions/setup-node@v3

- name: Download chrome-extension artifact
uses: actions/download-artifact@v2
with:
name: chrome-extension-${{ github.sha }}

- name: Install Web Store CLI
run: npm install -g chrome-webstore-upload-cli

- name: Upload extension
run: |
chrome-webstore-upload upload \
--source chrome-extension-${{ github.sha }}.zip \
--extension-id ${{ env.EXTENSION_ID }} \
--client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} \
--client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} \
--refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }}
build-chrome-extension:
name: Build Chrome extension artifact
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3

- name: Install dependencies
run: npm install

- name: Build extension
run: |
npm run build
zip -r chrome-extension-${{ github.sha }}.zip dist
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}

- name: Archive chrome-extension artifact
uses: actions/upload-artifact@v2
with:
name: chrome-extension-${{ github.sha }}
path: chrome-extension-${{ github.sha }}.zip

upload-extension:
name: Upload Chrome extension artifact to Chrome Web Store
needs: build-chrome-extension
runs-on: ubuntu-latest
env:
EXTENSION_ID: doilmgfedjlpepeaolcfpdmkehecdaff

steps:
- name: Set up Node.js
uses: actions/setup-node@v3

- name: Download chrome-extension artifact
uses: actions/download-artifact@v2
with:
name: chrome-extension-${{ github.sha }}

- name: Install Web Store CLI
run: npm install -g chrome-webstore-upload-cli

- name: Upload extension
run: |
chrome-webstore-upload upload \
--source chrome-extension-${{ github.sha }}.zip \
--extension-id ${{ env.EXTENSION_ID }} \
--client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} \
--client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} \
--refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }}
124 changes: 62 additions & 62 deletions .github/workflows/main_profstats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,73 @@
name: Build and deploy container app to Azure Web App - profstats

on:
push:
branches:
- main
paths:
- '.github/workflows/main_profstats.yml'
- 'api/**'
- 'db_setup/**'
- 'raw_data/**'
workflow_dispatch:
push:
branches:
- main
paths:
- ".github/workflows/main_profstats.yml"
- "api/**"
- "db_setup/**"
- "raw_data/**"
workflow_dispatch:

jobs:
build:
runs-on: 'ubuntu-latest'
build:
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
steps:
- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Run create_db.py
run: python db_setup/create_db.py

- name: Run test_db.py
run: python db_setup/test_db.py
continue-on-error: false

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Install dependencies
working-directory: api
run: go get .
- name: Test with Go
working-directory: api
run: go test -v ./...
continue-on-error: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to registry
uses: docker/login-action@v2
with:
registry: https://profstats.azurecr.io/
username: ${{ secrets.AzureAppService_ContainerUsername_50382c2ff2f34ee4bf7c325124b387fb }}
password: ${{ secrets.AzureAppService_ContainerPassword_6ac2726f47784a378b4cf66a20d5489b }}
- name: Run create_db.py
run: python db_setup/create_db.py

- name: Build and push container image to registry
uses: docker/build-push-action@v3
with:
context: api
push: true
tags: profstats.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_50382c2ff2f34ee4bf7c325124b387fb }}/profstats:${{ github.sha }}
file: api/Dockerfile
- name: Run test_db.py
run: python db_setup/test_db.py
continue-on-error: false

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: Install dependencies
working-directory: api
run: go get .
- name: Test with Go
working-directory: api
run: go test -v ./...
continue-on-error: false

steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'profstats'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_022c124f26704ddcb13d6a1298cfe55b }}
images: 'profstats.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_50382c2ff2f34ee4bf7c325124b387fb }}/profstats:${{ github.sha }}'
- name: Log in to registry
uses: docker/login-action@v2
with:
registry: https://profstats.azurecr.io/
username: ${{ secrets.AzureAppService_ContainerUsername_50382c2ff2f34ee4bf7c325124b387fb }}
password: ${{ secrets.AzureAppService_ContainerPassword_6ac2726f47784a378b4cf66a20d5489b }}

- name: Build and push container image to registry
uses: docker/build-push-action@v3
with:
context: api
push: true
tags: profstats.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_50382c2ff2f34ee4bf7c325124b387fb }}/profstats:${{ github.sha }}
file: api/Dockerfile

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: "production"
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: "profstats"
slot-name: "production"
publish-profile: ${{ secrets.AzureAppService_PublishProfile_022c124f26704ddcb13d6a1298cfe55b }}
images: "profstats.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_50382c2ff2f34ee4bf7c325124b387fb }}/profstats:${{ github.sha }}"
76 changes: 0 additions & 76 deletions .github/workflows/main_profstatsutd.yml

This file was deleted.

44 changes: 22 additions & 22 deletions .github/workflows/prettier-lint-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@ name: Lint and Formatting Check

on:
push:
paths:
- 'src/**'
- '.eslintrc.js'
- '.prettierrc.js'
- 'utils/**'
- '.github/workflows/prettier-lint-check.yml'
paths:
- "src/**"
- ".eslintrc.js"
- ".prettierrc.js"
- "utils/**"
- ".github/workflows/prettier-lint-check.yml"
workflow_dispatch:

jobs:
main:
name: Run ESLint + Prettier
runs-on: ubuntu-latest
main:
name: Run ESLint + Prettier
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3
steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install ESLint and Prettier
run: npm install
- name: Install ESLint and Prettier
run: npm install

- name: Run ESLint
run: npm run lint:check
- name: Run ESLint
run: npm run lint:check

- name: Run Prettier
run: npm run format:check
- name: Run Prettier
run: npm run format:check
6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

Loading

0 comments on commit 65d31f8

Please sign in to comment.