Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6726b95
commit c14186c
Showing
9 changed files
with
154 additions
and
41 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,4 @@ | ||
/.nuxt | ||
/dist | ||
/node_modules | ||
/coverage |
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,59 @@ | ||
name: "Make Docker Image" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: | ||
- * | ||
|
||
jobs: | ||
build: | ||
name: "Build Image" | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
node: [ 16 ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Dotenv File | ||
uses: actually-colab/github-action-create-env-file@v2.3 | ||
with: | ||
envkey_CEVER_VERSION: ${{ github.ref }} | ||
file_name: .env | ||
directory: . | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
hoshinosuzumi/cfever:latest | ||
hoshinosuzumi/cfever:${{ github.ref }} | ||
ghcr.io/uniiemstudio/ctfever:latest | ||
ghcr.io/uniiemstudio/ctfever:${{ github.ref }} |
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 |
---|---|---|
|
@@ -44,6 +44,8 @@ jobs: | |
run: yarn test | ||
|
||
- name: Build 🛠️ | ||
env: | ||
CEVER_RUN_MODE: static | ||
run: | | ||
yarn generate | ||
ls -la | ||
|
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,17 +1,25 @@ | ||
FROM node:14-alpine as build-stage | ||
ADD . /build_dir | ||
|
||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories | ||
RUN apk add --update --no-cache gcc g++ make cmake curl jq py3-configobj py3-pip py3-setuptools python3 python3-dev | ||
|
||
RUN cd /build_dir \ | ||
&& yarn install \ | ||
&& yarn run build \ | ||
&& yarn run generate \ | ||
&& mv dist /dist | ||
|
||
FROM nginx:stable-alpine as production-stage | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY --from=build-stage /dist /usr/share/nginx/html | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] | ||
FROM node:16-alpine as build-stage | ||
|
||
WORKDIR /build | ||
COPY . . | ||
|
||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories | ||
RUN apk add --update --no-cache gcc g++ make cmake curl jq py3-configobj py3-pip py3-setuptools python3 python3-dev | ||
|
||
RUN yarn install && \ | ||
yarn run build | ||
|
||
FROM node:16-alpine as production-stage | ||
|
||
LABEL maintainer="hoshinosuzumi" | ||
LABEL org.opencontainers.image.source=https://github.com/UniiemStudio/CTFever | ||
|
||
ENV CEVER_RUN_MODE=server | ||
ENV CEVER_BACKEND_BASE=https://ctfever-service.uniiem.com | ||
|
||
WORKDIR /app | ||
COPY --from=build-stage /build . | ||
|
||
EXPOSE 3000 | ||
|
||
CMD yarn start |
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
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
This file was deleted.
Oops, something went wrong.
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
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