Skip to content

Commit

Permalink
Merge pull request #1664 from ever-co/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Oct 26, 2023
2 parents 6d17950 + 53d03c5 commit 131c7d1
Show file tree
Hide file tree
Showing 22 changed files with 1,250 additions and 390 deletions.
34 changes: 34 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ docker-compose*.yml
.gitignore
Jenkinsfile

**/.next
**/build
**/node_modules/*
**/dist
**/out

**/*.log

**/.vscode
**/.env.local
**/.env*.local

fly.toml

node_modules

apps/mobile/node_modules
Expand All @@ -40,3 +54,23 @@ e2e/*.map
#System Files
.DS_Store
Thumbs.db

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# Sentry Auth Token
.sentryclirc
28 changes: 28 additions & 0 deletions .github/workflows/mobile-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
deploy:
runs-on: ubuntu-latest

environment: prod

permissions:
contents: read

Expand Down Expand Up @@ -52,3 +54,29 @@ jobs:

- name: Publish update
run: cd apps/mobile && eas update --auto

- name: Decode Google Credentials
run: |
DECODED_GOOGLE_CREDENTIALS=$(echo '${{ secrets.GOOGLE_CREDENTIALS }}' | base64 --decode)
echo "DECODED_GOOGLE_CREDENTIALS=$DECODED_GOOGLE_CREDENTIALS" >> $GITHUB_ENV
echo "::add-mask::$DECODED_GOOGLE_CREDENTIALS"
ESCAPED_GOOGLE_CREDENTIALS=$(echo "$DECODED_GOOGLE_CREDENTIALS" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g')
ESCAPED_GOOGLE_CREDENTIALS=$(echo $ESCAPED_GOOGLE_CREDENTIALS | sed 's/\\n/\\\\n/g')
echo "ESCAPED_GOOGLE_CREDENTIALS=$ESCAPED_GOOGLE_CREDENTIALS" >> $GITHUB_ENV
echo "::add-mask::$ESCAPED_GOOGLE_CREDENTIALS"
# See https://github.com/ever-co/ever-teams-boards-store/blob/develop/.github/workflows/deploy.yml

- name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v1"
with:
credentials_json: ${{ env.DECODED_GOOGLE_CREDENTIALS }}

# Install gcloud, `setup-gcloud` automatically picks up authentication from `auth`.
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"
with:
project_id: "ever-teams-399720"

- name: Upload to Play Store Console
run: cd apps/mobile && eas submit -p android --latest --key ${{ secrets.GOOGLE_CREDENTIALS }}
57 changes: 57 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# syntax = docker/dockerfile:1

# Adjust NODE_VERSION as desired
ARG NODE_VERSION=18.17.1
FROM node:${NODE_VERSION}-slim as base


# Next.js app lives here
WORKDIR /app

# Set production environment
ENV NEXT_SHARP_PATH=/app/node_modules/sharp


# Throw-away build stage to reduce size of final image
FROM base as build

# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install -y build-essential pkg-config python-is-python3

# Install Yarn
RUN npm install -g yarn --force

# Install node modules
COPY --link package.json ./
COPY --link yarn.lock ./
COPY --link apps/web/package.json ./apps/web/package.json

RUN cd apps/web && \
yarn install --ignore-scripts

# Copy application code
COPY --link . .

ENV NODE_ENV="production"

# Build application
RUN yarn run build:web

# Remove development dependencies
RUN cd apps/web && \
yarn install --prod --ignore-scripts


# Final stage for app image
FROM base

ENV NODE_ENV="production"

# Copy built application
COPY --from=build /app /app

# Start the server by default, this can be overwritten at runtime
EXPOSE 3000

CMD [ "npm", "run", "start:web" ]
Loading

0 comments on commit 131c7d1

Please sign in to comment.