Skip to content

Commit

Permalink
Merge branch 'main' into ORAKEI-Staging
Browse files Browse the repository at this point in the history
  • Loading branch information
AntGa committed Oct 14, 2024
2 parents cb1b1b4 + 41a0a60 commit eb1cf18
Show file tree
Hide file tree
Showing 118 changed files with 5,081 additions and 2,457 deletions.
50 changes: 26 additions & 24 deletions .github/workflows/deploy.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- ORAKEI-Staging
- ORAKEI-Fly-Volume

jobs: # remove these tests in production - Anton
test-vars:
Expand All @@ -27,28 +28,29 @@ jobs: # remove these tests in production - Anton
run: echo "Notion Homepage is ${{ secrets.NOTION_PROJECTS_ID}}"

deploy-web:
name: Deploy Web
runs-on: ubuntu-latest
environment: Notion
env:
# This is probably not needed I just have it here for testing - Anton
FLY_API_TOKEN: ${{ secrets.FLY_STAGING_API_TOKEN }}
ANTON: ${{ secrets.ANTON }}
AntonVar: ${{ vars.ANTONVAR }}
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
NOTION_MEMBERS_ID: ${{ secrets.NOTION_MEMBERS_ID }}
NOTION_HOMEPAGE_ID: ${{ secrets.NOTION_HOMEPAGE_ID}}
NOTION_TEAMS_ID: ${{ secrets.NOTION_TEAMS_ID }}
WEBFORMS_TOKEN: ${{ secrets.WEBFORMS_TOKEN }}
NOTION_PROJECTS_ID: ${{ secrets.NOTION_PROJECTS_ID}}
NOTION_REFRESH_ID: ${{ secrets.NOTION_REFRESH_ID }}
steps:

- name: actions checkout v3
uses: actions/checkout@v3

- name: setup flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
name: Deploy Web
runs-on: ubuntu-latest
environment: Notion
env:
FLY_API_TOKEN: ${{ secrets.FLY_STAGING_API_TOKEN }}
ANTON: ${{ secrets.ANTON }}
AntonVar: ${{ vars.ANTONVAR }}
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
NOTION_MEMBERS_ID: ${{ secrets.NOTION_MEMBERS_ID }}
NOTION_HOMEPAGE_ID: ${{ secrets.NOTION_HOMEPAGE_ID }}
NOTION_TEAMS_ID: ${{ secrets.NOTION_TEAMS_ID }}
WEBFORMS_TOKEN: ${{ secrets.WEBFORMS_TOKEN }}
NOTION_PROJECTS_ID: ${{ secrets.NOTION_PROJECTS_ID }}
NOTION_REFRESH_ID: ${{ secrets.NOTION_REFRESH_ID }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DIRECT_URL: ${{ secrets.DIRECT_URL }}
SERVICE_KEY: ${{ secrets.SERVICE_KEY }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
steps:
- name: actions checkout v3
uses: actions/checkout@v3
- name: setup flyctl
uses: superfly/flyctl-actions/setup-flyctl@master

- name: Fly deploy
run: flyctl deploy --build-arg ANTON=${{ secrets.ANTON }} --build-arg WEBFORMS_TOKEN=${{ secrets.WEBFORMS_TOKEN }} --build-arg NOTION_MEMBERS_ID=${{ secrets.NOTION_MEMBERS_ID }} --build-arg NOTION_TOKEN=${{ secrets.NOTION_TOKEN }} --build-arg NOTION_PROJECTS_ID=${{ secrets.NOTION_PROJECTS_ID }} --build-arg NOTION_TEAMS_ID=${{ secrets.NOTION_TEAMS_ID}} --build-arg NOTION_HOMEPAGE_ID=${{ secrets.NOTION_HOMEPAGE_ID}} --build-arg NOTION_REFRESH_ID=${{ secrets.NOTION_REFRESH_ID}} --remote-only --config fly.staging.toml
- name: Fly deploy
run: flyctl deploy --build-arg ANTON=${{ secrets.ANTON }} --build-arg WEBFORMS_TOKEN=${{ secrets.WEBFORMS_TOKEN }} --build-arg NOTION_MEMBERS_ID=${{ secrets.NOTION_MEMBERS_ID }} --build-arg NOTION_TOKEN=${{ secrets.NOTION_TOKEN }} --build-arg NOTION_PROJECTS_ID=${{ secrets.NOTION_PROJECTS_ID }} --build-arg NOTION_TEAMS_ID=${{ secrets.NOTION_TEAMS_ID }} --build-arg NOTION_HOMEPAGE_ID=${{ secrets.NOTION_HOMEPAGE_ID }} --build-arg NOTION_REFRESH_ID=${{ secrets.NOTION_REFRESH_ID }} --build-arg DATABASE_URL=${{ secrets.DATABASE_URL }} --build-arg DIRECT_URL=${{ secrets.DIRECT_URL }} --build-arg SUPABASE_URL=${{ secrets.SUPABASE_URL }} --build-arg SERVICE_KEY=${{ secrets.SERVICE_KEY }} --remote-only --config fly.staging.toml
30 changes: 22 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ ARG NOTION_PROJECTS_ID
ARG NOTION_TEAMS_ID
ARG NOTION_HOMEPAGE_ID
ARG NOTION_REFRESH_ID

ARG DATABASE_URL
ARG DIRECT_URL
ARG SUPABASE_URL
ARG SERVICE_KEY

# Set build-time environment variables
ENV ANTON=${ANTON}
Expand All @@ -34,36 +37,47 @@ ENV NOTION_PROJECTS_ID=${NOTION_PROJECTS_ID}
ENV NOTION_TEAMS_ID=${NOTION_TEAMS_ID}
ENV NOTION_HOMEPAGE_ID=${NOTION_HOMEPAGE_ID}
ENV NOTION_REFRESH_ID=${NOTION_REFRESH_ID}


ENV DATABASE_URL=${DATABASE_URL}
ENV DIRECT_URL=${DIRECT_URL}
ENV SUPABASE_URL=${SUPABASE_URL}
ENV SERVICE_KEY=${SERVICE_KEY}

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

# Install packages needed to build node modules
# Install packages needed to build node modules and for Prisma (including OpenSSL)
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 openssl

# Install node modules
COPY --link package.json yarn.lock ./
COPY --link package.json yarn.lock ./
RUN yarn install --frozen-lockfile --production=false

# Copy application code
COPY --link . .

# Generate Prisma client and run migrations
RUN npx prisma generate && \
npx prisma migrate deploy && \
npx prisma migrate status

# Build application
RUN yarn run build

# Remove development dependencies
# Remove development dependencies to keep the final image small
RUN yarn install --production=true

# Final stage for app image
FROM base

# Install OpenSSL in the final image (since Prisma needs it to run)
RUN apt-get update -qq && apt-get install --no-install-recommends -y openssl

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

# Copy node modules
COPY --from=build /app/node_modules /app/node_modules

# Start the server by default, this can be overwritten at runtime
CMD [ "node", "/app/dist/server/entry.mjs" ]
CMD [ "node", "/app/dist/server/entry.mjs" ]
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ All commands are run from the root of the project, from a terminal:
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## Contributors - Team Houston

| Member | Photo |
| :------------------------ | :----------------------------------------------- |
| Chris Valenzuela | Placeholder |
| Yash Kumar | Placeholder |
| Eleanor Crellin | Placeholder |
| Becky Cheng | Placeholder |
| Emmanuel Araba | Placeholder |
| Anna Lin | Placeholder |
| Kimberley Zhu | Placeholder |
| Owen Li | Placeholder |
| Anton Garay | Placeholder |
| Andrew Qiu | Placeholder |

Houston
Chris Valenzuela
Yash Kumar
Eleanor Crellin
Becky Cheng
Emmanuel Araba
Anna Lin
Kimberley Zhu
Owen Li
Anton Garay
Andrew Qiu
Loading

0 comments on commit eb1cf18

Please sign in to comment.