-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
29 changed files
with
442 additions
and
283 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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
name: Release | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
@@ -34,31 +37,25 @@ jobs: | |
restore-keys: | | ||
${{ runner.os }}- | ||
- uses: pnpm/action-setup@v2.0.1 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: true | ||
|
||
- name: Build | ||
- name: Build client | ||
working-directory: packages/client/ | ||
run: pnpm build | ||
|
||
- name: Build server | ||
working-directory: packages/server/ | ||
run: pnpm build | ||
|
||
- name: Build the Docker image | ||
run: docker build --file packages/server/Containerfile --tag $IMAGE_NAME:latest --cache-from ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest . | ||
|
||
- name: Login to DockerHub registry | ||
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} | ||
run: docker build --tag $IMAGE_NAME:latest --cache-from ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest . | ||
|
||
- name: Log in to Github registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
|
||
- name: Push image to DockerHub (latest & tag) | ||
run: | | ||
docker tag $IMAGE_NAME:latest ${{ env.DOCKERHUB_ORG }}/$IMAGE_NAME:latest | ||
docker push ${{ env.DOCKERHUB_ORG }}/$IMAGE_NAME:latest | ||
docker tag $IMAGE_NAME:latest ${{ env.DOCKERHUB_ORG }}/$IMAGE_NAME:${GITHUB_REF#refs/*/} | ||
docker push ${{ env.DOCKERHUB_ORG }}/$IMAGE_NAME:${GITHUB_REF#refs/*/} | ||
if: "github.ref_type == 'tag'" | ||
if: github.event_name != 'pull_request' | ||
|
||
- name: Push image to Github registry (latest & tag) | ||
run: | | ||
|
@@ -68,17 +65,11 @@ jobs: | |
docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:${GITHUB_REF#refs/*/} | ||
if: "github.ref_type == 'tag'" | ||
|
||
- name: Push image to DockerHub (next) | ||
run: | | ||
docker tag $IMAGE_NAME:latest ${{ env.DOCKERHUB_ORG }}/$IMAGE_NAME:next | ||
docker push ${{ env.DOCKERHUB_ORG }}/$IMAGE_NAME:next | ||
if: "github.ref_type != 'tag'" | ||
|
||
- name: Push image to Github registry (next) | ||
run: | | ||
docker tag $IMAGE_NAME:latest ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:next | ||
docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:next | ||
if: "github.ref_type != 'tag'" | ||
if: github.event_name != 'pull_request' && github.ref_type != 'tag' | ||
|
||
client: | ||
name: Release client | ||
|
@@ -108,7 +99,7 @@ jobs: | |
restore-keys: | | ||
${{ runner.os }}- | ||
- uses: pnpm/action-setup@v2.0.1 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: true | ||
|
@@ -133,15 +124,6 @@ jobs: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
if: "github.ref_type == 'tag'" | ||
|
||
# - name: Release pre version | ||
# working-directory: packages/client/ | ||
# run: | | ||
# pnpm version 1.0.0-pre.1 --no-commit-hooks --no-git-tag-version | ||
# pnpm publish --no-git-check --access public --tag pre | ||
# env: | ||
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
# if: "github.ref_type != 'tag'" | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM node:18-alpine as overmind | ||
WORKDIR /app | ||
RUN apk add --update curl gzip | ||
RUN curl https://github.com/DarthSim/overmind/releases/download/v2.4.0/overmind-v2.4.0-linux-amd64.gz -L -o overmind.gz | ||
RUN gunzip overmind.gz | ||
RUN chmod +x overmind | ||
|
||
FROM node:18-alpine | ||
ENV NODE_ENV=production | ||
ENV DATA_PATH=/app/data | ||
RUN apk --no-cache add ca-certificates tmux | ||
EXPOSE 7171 | ||
WORKDIR /app | ||
CMD ["overmind", "start"] | ||
COPY Procfile . | ||
COPY --from=overmind /app/overmind /bin/overmind | ||
|
||
# server | ||
COPY ./packages/server/dist/ . | ||
COPY ./packages/server/public/ ./public | ||
COPY ./packages/server/templates/ ./templates | ||
|
||
# TODO: used to suppress warning remove after fixed | ||
RUN mkdir -p /static | ||
|
||
RUN chown -R node:node /app |
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 @@ | ||
api: PORT=7171 node --enable-source-maps index.js |
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
Oops, something went wrong.