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

[Sweep GHA Fix] Fix failing GitHub Actions on commit 54c1857 #24

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI/CD

on:
push:
branches:
- main

env:
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_API_KEY: ${{ secrets.NEXT_PUBLIC_API_KEY }}

jobs:
build:
runs-on: ubuntu-latest

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

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14

- name: Install dependencies
run: npm ci

- name: Build Next.js application
run: npm run build

- name: Run tests
run: npm run test

- name: Deploy to production
run: npm run deploy
env:
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_API_KEY: ${{ secrets.NEXT_PUBLIC_API_KEY }}
4 changes: 2 additions & 2 deletions projects/fastgpt/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install dependencies only when needed
FROM node:18.15-alpine AS deps
FROM node:14 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add libc6-compat && npm install -g pnpm
WORKDIR /app
Expand Down Expand Up @@ -47,7 +47,7 @@ ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
ENV PORT=3000

EXPOSE 3000
EXPOSE $PORT

USER nextjs

Expand Down
6 changes: 3 additions & 3 deletions projects/xiaoyi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install dependencies only when needed
FROM node:18.15-alpine AS deps
FROM node:14 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add libc6-compat && npm install -g pnpm
WORKDIR /app
Expand All @@ -24,7 +24,7 @@ ENV NEXT_TELEMETRY_DISABLED 1
RUN npm install -g pnpm
RUN pnpm run build

FROM node:18.15-alpine AS runner
FROM node:14 AS runner
WORKDIR /app

# create user and use it
Expand All @@ -46,7 +46,7 @@ ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
ENV PORT=3000

EXPOSE 3000
EXPOSE $PORT

USER nextjs

Expand Down