Skip to content

Commit

Permalink
upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsalcido committed Nov 3, 2023
1 parent 9e1fc24 commit 73e29c7
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 184 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
node_modules
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
Makefile
helm-charts
.env*
.editorconfig
.idea
coverage*
.next
38 changes: 23 additions & 15 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: |
echo "IMAGE_NAME_WITH_REGISTRY=$DOCKER_REGISTRY/$IMAGE_NAME" >> $GITHUB_ENV
echo "GOOGLE_TAG_ID=$GOOGLE_TAG_ID" >> $GITHUB_ENV
echo "POSTHOG_ID=$POSTHOG_ID" >> $GITHUB_ENV
echo "TELEGRAM_TO=$TELEGRAM_TO" >> $GITHUB_ENV
echo "TELEGRAM_TOKEN=$TELEGRAM_TOKEN" >> $GITHUB_ENV
echo "POSTHOG_WEBHOOK_TOKEN=$POSTHOG_WEBHOOK_TOKEN" >> $GITHUB_ENV
export IMAGE_NAME_WITH_REGISTRY=$DOCKER_REGISTRY/$IMAGE_NAME
echo "FULL_IMAGE_NAME=$IMAGE_NAME_WITH_REGISTRY:$GITHUB_SHA-gitsha" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
# Setup Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Build and push Docker Image
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Release to DockerHub
shell: bash
run: ./build_and_push.sh
- name: Preset Image Name
run: echo "IMAGE_URL=$(echo ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:$(echo ${{ github.sha }} | cut -c1-7) | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Build and push Docker Image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.IMAGE_URL }}
build-args: |
GOOGLE_TAG_ID=${{ secrets.GOOGLE_TAG_ID }}
POSTHOG_ID=${{ secrets.POSTHOG_ID }}
TELEGRAM_TO=${{ secrets.TELEGRAM_TO }}
TELEGRAM_TOKEN=${{ secrets.TELEGRAM_TOKEN }}
POSTHOG_WEBHOOK_TOKEN=${{ secrets.POSTHOG_WEBHOOK_TOKEN }}
- name: Deploy to CapRover
uses: caprover/deploy-from-github@d76580d79952f6841c453bb3ed37ef452b19752c
with:
Expand Down
6 changes: 1 addition & 5 deletions Dockerfile.caprover → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.15.0-alpine AS base
FROM node:20-alpine AS base

### Dependencies
# Environment Variables
Expand Down Expand Up @@ -51,10 +51,6 @@ COPY --from=builder /app/public ./public
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/.next ./.next
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
# COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
# COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs
EXPOSE 3000
Expand Down
Binary file added bun.lockb
Binary file not shown.
Loading

0 comments on commit 73e29c7

Please sign in to comment.