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

feat(provider): added cicd #706

Merged
merged 4 commits into from
Feb 4, 2025
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ jobs:
elif [[ "$tag" == provider-proxy/* ]]; then
echo "registry=${{ vars.PROVIDER_PROXY_REGISTRY }}" >> $GITHUB_ENV
echo "app=provider-proxy" >> $GITHUB_ENV
elif [[ "$tag" == provider-console/* ]]; then
echo "registry=${{ vars.PROVIDER_CONSOLE_REGISTRY }}" >> $GITHUB_ENV
echo "app=provider-console" >> $GITHUB_ENV
else
echo "Error: Unknown tag format = $tag"
exit 1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
git_tag="console-api/v$git_tag"
elif [ "${{ inputs.app }}" = "provider-proxy" ]; then
git_tag="provider-proxy/v$git_tag"
elif [ "${{ inputs.app }}" = "provider-console" ]; then
git_tag="provider-console/v$git_tag"
else
echo "Error: Unsupported app type '${{ inputs.app }}'."
exit 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/create-pre-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
npm run release -w apps/api -- --verbose --ci
npm run release -w apps/deploy-web -- --verbose --ci
npm run release -w apps/provider-proxy -- --verbose --ci
npm run release -w apps/provider-console -- --verbose --ci
- name: Get Base Branch SHA
id: get-base-sha
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/docker-build-provider-console.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy Provider Console CI

on:
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Check for changes in provider-console folder
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
provider-console:
- 'apps/provider-console/**'

- name: Build the Docker image
if: steps.filter.outputs.provider-console == 'true'
run: packages/docker/script/dc.sh build provider-console --build-arg DEPLOYMENT_ENV=production
40 changes: 40 additions & 0 deletions .github/workflows/release-provider-console.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release Deploy Web

on:
push:
branches:
- main
paths:
- "apps/provider-console/package.json"

jobs:
release:
name: Create Release
uses: ./.github/workflows/create-github-release.yml
secrets: inherit
with:
app: provider-console

build-beta:
needs: release
name: Build Beta Docker image
uses: ./.github/workflows/build-image.yml
secrets: inherit
permissions:
contents: write
packages: write
with:
tag: ${{ needs.release.outputs.version }}-beta
deployment-env: staging

build-prod:
needs: release
name: Build Prod Docker image
uses: ./.github/workflows/build-image.yml
secrets: inherit
permissions:
contents: write
packages: write
with:
tag: ${{ needs.release.outputs.version }}
deployment-env: production
1 change: 1 addition & 0 deletions apps/provider-console/.release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@akashnetwork/releaser");
2 changes: 2 additions & 0 deletions apps/provider-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
"dev": "next -p 3000",
"format": "prettier --write ./*.{ts,js,json} **/*.{ts,tsx,js,json}",
"lint": "eslint .",
"release": "release-it",
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: you need to change package name to @akashnetwork/provider-console otherwise changelog generator will not be able to find corresponding tags and will always generate changelog starting from the 1st commit in this package

"start": "next start",
"type-check": "tsc"
},
"dependencies": {
"@akashnetwork/releaser": "*",
"@akashnetwork/ui": "*",
"@chain-registry/types": "^0.50.1",
"@cosmos-kit/cosmostation-extension": "^2.12.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useRouter } from "next/router";
interface ProviderAction {
id: string;
name: string;
status: "completed" | "in_progress" | "pending" | "failed";
status: "completed" | "in_progress" | "pending" | "failed" | "not_started";
start_time: string;
end_time?: string;
}
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.