-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from AElfProject/ci/sonarqube
ci: sonarqube
- Loading branch information
Showing
4 changed files
with
28 additions
and
51 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,21 @@ | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
name: SonarQube | ||
jobs: | ||
sonarqube: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Disabling shallow clones is recommended for improving the relevancy of reporting | ||
fetch-depth: 0 | ||
- name: SonarQube Scan | ||
uses: sonarsource/[email protected] # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | ||
with: | ||
args: > | ||
-Dsonar.projectKey=aelf-playground-next |
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 |
---|---|---|
@@ -1,33 +1,22 @@ | ||
FROM node:20-alpine AS base | ||
FROM cgr.dev/chainguard/node | ||
|
||
# Production image, copy all the files and run next | ||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV production | ||
|
||
# Uncomment the following line in case you want to disable telemetry during runtime. | ||
# ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
COPY ./public ./public | ||
|
||
# Set the correct permission for prerender cache | ||
RUN mkdir .next | ||
RUN chown nextjs:nodejs .next | ||
|
||
# Automatically leverage output traces to reduce image size | ||
# https://nextjs.org/docs/advanced-features/output-file-tracing | ||
COPY --chown=nextjs:nodejs ./.next/standalone ./ | ||
COPY --chown=nextjs:nodejs ./.next/static ./.next/static | ||
|
||
USER nextjs | ||
COPY ./.next/standalone ./ | ||
COPY ./.next/static ./.next/static | ||
|
||
EXPOSE 3000 | ||
ENV HOSTNAME=0.0.0.0 | ||
|
||
ENV PORT 3000 | ||
USER node | ||
|
||
# server.js is created by next build from the standalone output | ||
# https://nextjs.org/docs/pages/api-reference/next-config-js/output | ||
CMD HOSTNAME="0.0.0.0" node server.js | ||
CMD [ "server.js" ] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.