-
Notifications
You must be signed in to change notification settings - Fork 19
Build/ci #73
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
Build/ci #73
Changes from all commits
4a9591c
76492a1
df2a397
64cd44a
9f324ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,141 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: ci | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ci-check-server: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: ci-check-server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-python@v5.1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: "3.11" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Cache pip | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/cache@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: ~/.cache/pip | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key: ${{ runner.os }}-pip-${{ hashFiles('server/requirements.lock') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ${{ runner.os }}-pip- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pip install -r echo/server/requirements.lock | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run mypy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: tsuyoshicho/action-mypy@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reporter: github-pr-review | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| level: warning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workdir: echo/server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run ruff | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: chartboost/ruff-action@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| src: echo/server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ci-check-frontend: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: ci-check-frontend | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defaults: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: ./echo/frontend/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Node.js | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-node@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| node-version: "22" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+59
to
+63
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Update Node.js Setup Action Version - uses: actions/setup-node@v3
+ uses: actions/setup-node@v4📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.4)60-60: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install pnpm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: pnpm/action-setup@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version: 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Get pnpm store directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: pnpm-cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/cache@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Setup pnpm cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| restore-keys: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ${{ runner.os }}-pnpm-store- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+75
to
+82
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Refresh PNPM Cache Action Version - uses: actions/cache@v3
+ uses: actions/cache@v4📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.4)75-75: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm install --frozen-lockfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Lint and build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: pnpm run build | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ci-build-and-push-servers: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: ci-build-servers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: [ci-check-server, ci-check-frontend] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Directus | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: dbr-echo-directus | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| context: ./echo/directus | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dockerfile: Dockerfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tag: dbr-echo-directus | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build_args: "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Shared image for server and worker | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: dbr-echo-server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| context: ./echo/server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dockerfile: Dockerfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tag: dbr-echo-server | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build_args: "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout Code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+110
to
+112
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Upgrade Checkout Action in Build-and-Push Job - uses: actions/checkout@v3
+ uses: actions/checkout@v4📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.4)111-111: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🪛 YAMLlint (1.35.1)[error] 112-112: trailing spaces (trailing-spaces) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up Docker Buildx | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: docker/setup-buildx-action@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This enables the creation of a builder instance with persistent cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| driver-opts: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image=moby/buildkit:latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| network=host | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+113
to
+120
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent ❓ Verification inconclusiveRefresh Docker Buildx Setup Action Version & Clean Trailing Spaces - uses: docker/setup-buildx-action@v2
+ uses: docker/setup-buildx-action@v3Update Docker Buildx Action to v3 & Remove Trailing Spaces Hey, fellow engineer—this CI workflow is still rocking the old - uses: docker/setup-buildx-action@v2
+ uses: docker/setup-buildx-action@v3
Cheers and LGTM! 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.4)114-114: the runner of "docker/setup-buildx-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🪛 YAMLlint (1.35.1)[error] 120-120: trailing spaces (trailing-spaces) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Log in to DigitalOcean Container Registry | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: docker/login-action@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| registry: registry.digitalocean.com | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| username: ${{ secrets.DO_REGISTRY_USERNAME }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| password: ${{ secrets.DO_REGISTRY_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+121
to
+127
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent ❓ Verification inconclusiveUpgrade Docker Login Action and Clean Formatting - uses: docker/login-action@v2
+ uses: docker/login-action@v3Action Required: Upgrade Docker Login Action and Tidy Trailing Whitespace Please update the CI workflow step in
- uses: docker/login-action@v2
+ uses: docker/login-action@v3LGTM—but these fixes are needed to keep your CI config cutting edge and squeaky clean. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.4)122-122: the runner of "docker/login-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🪛 YAMLlint (1.35.1)[error] 127-127: trailing spaces (trailing-spaces) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build (also push sometimes) ${{ matrix.image.name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: docker/build-push-action@v3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| context: ${{ matrix.image.context }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file: ${{ matrix.image.context }}/${{ matrix.image.dockerfile }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Only push if the event is a push event to main. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: ${{ github.event_name == 'push' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tags: registry.digitalocean.com/dbr-cr/${{ matrix.image.tag }}:${{ github.sha }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| build-args: ${{ matrix.image.build_args }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Enhanced cache settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cache-from: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type=gha,scope=${{ matrix.image.name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type=registry,ref=registry.digitalocean.com/dbr-cr/${{ matrix.image.tag }}:latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cache-to: type=gha,scope=${{ matrix.image.name }},mode=max | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+128
to
+141
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent ❓ Verification inconclusiveUpdate Docker Build-Push Action Version - uses: docker/build-push-action@v3
+ uses: docker/build-push-action@v4Action Required: Upgrade Docker Build-Push Action to v4
Thanks for staying ahead of the curve! 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.4)129-129: the runner of "docker/build-push-action@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue (action) 🪛 YAMLlint (1.35.1)[error] 141-141: no new line character at the end of file (new-line-at-end-of-file) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: dev-deploy-vercel-dashboard | ||
| env: | ||
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DASHBOARD }} | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| dev-deploy-vercel-dashboard: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - uses: pnpm/action-setup@v2 | ||
| name: Install pnpm | ||
| with: | ||
| version: 10 | ||
| run_install: true | ||
| cwd: echo/frontend | ||
|
|
||
| - name: Install Vercel CLI | ||
| run: pnpm add --global vercel@latest | ||
| working-directory: echo/frontend | ||
|
|
||
| - name: Pull Vercel Environment Information | ||
| run: vercel pull --yes --environment=staging --token=${{ secrets.VERCEL_TOKEN }} | ||
| working-directory: echo/frontend | ||
|
|
||
| - name: Build Project Artifacts | ||
| run: vercel build --target=staging --token=${{ secrets.VERCEL_TOKEN }} | ||
| working-directory: echo/frontend | ||
|
|
||
| - name: Deploy Project Artifacts to Vercel | ||
| run: vercel deploy --prebuilt --target=staging --token=${{ secrets.VERCEL_TOKEN }} | ||
| working-directory: echo/frontend |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: dev-deploy-vercel-portal | ||
| env: | ||
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_PORTAL }} | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| dev-deploy-vercel-portal: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Install Node.js | ||
| uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - uses: pnpm/action-setup@v2 | ||
| name: Install pnpm | ||
| with: | ||
| version: 10 | ||
| run_install: true | ||
| cwd: echo/frontend | ||
|
|
||
| - name: Install Vercel CLI | ||
| run: pnpm add --global vercel@latest | ||
| working-directory: echo/frontend | ||
|
|
||
| - name: Pull Vercel Environment Information | ||
| run: vercel pull --yes --environment=staging --token=${{ secrets.VERCEL_TOKEN }} | ||
| working-directory: echo/frontend | ||
|
|
||
| - name: Build Project Artifacts | ||
| run: vercel build --target=staging --token=${{ secrets.VERCEL_TOKEN }} | ||
| working-directory: echo/frontend | ||
|
|
||
| - name: Deploy Project Artifacts to Vercel | ||
| run: vercel deploy --prebuilt --target=staging --token=${{ secrets.VERCEL_TOKEN }} | ||
| working-directory: echo/frontend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Update Cache Action Version for Python Dependencies
The step uses
actions/cache@v3to cache pip dependencies. Static analysis suggests that v3 is now outdated. Consider updating to a newer version (e.g. v4) to benefit from the latest fixes and performance improvements.📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.4)
26-26: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)