Skip to content

Commit

Permalink
ci: make workflows for dev and clean up prod workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rayokamoto committed May 27, 2024
1 parent cdd24e4 commit 8c9cd1e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 52 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/build_and_test.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/ci-dev-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Development - Pull Request
on:
pull_request:
branches:
- '**'

jobs:
lint-format:
name: Linting and Formatting Checks
uses: ./.github/workflows/lint-and-format.yml

build:
needs: lint-format
name: Build
runs-on: ubuntu-latest
environment: Development
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build Docker container
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
REDIS_URI: ${{ secrets.REDIS_URI }}
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
NEXT_PUBLIC_DRIVE_LINK: ${{ secrets.NEXT_PUBLIC_DRIVE_LINK }}
run: |
docker buildx build \
--secret id=DATABASE_URL \
--secret id=REDIS_URI \
--secret id=NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY \
--secret id=NEXT_PUBLIC_DRIVE_LINK \
--file=Dockerfile -t csclub-website .
11 changes: 11 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Development
on:
push:
branches:
- '**'
- '!main'

jobs:
lint-format:
name: Linting and Formatting Checks
uses: ./.github/workflows/lint-and-format.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Deploy
name: Production

on:
push:
branches: [main, ci-aws] # ci-aws is temporary
branches: [main]

env:
AWS_REGION: ap-southeast-2

jobs:
# lint-format:
# name: Linting and Formatting Checks
# uses: ./.github/workflows/lint-and-format.yml
lint-format:
name: Linting and Formatting Checks
uses: ./.github/workflows/lint-and-format.yml

build:
# needs: lint-format
needs: lint-format
name: Build
runs-on: [self-hosted, ARM64] # Since deployment is on arm64
environment: Production
Expand Down

0 comments on commit 8c9cd1e

Please sign in to comment.