Skip to content

Merge pull request #99 from ThunLights/dependabot/github_actions/acti… #436

Merge pull request #99 from ThunLights/dependabot/github_actions/acti…

Merge pull request #99 from ThunLights/dependabot/github_actions/acti… #436

Workflow file for this run

name: CI
on:
pull_request:
pull_request_target:
push:
branches:
- main
- release-*
concurrency:
group: pr-ci-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
env:
PUBLIC_URL: http://localhost:3000
PUBLIC_OWNER_ID: "1261634733037719593"
PUBLIC_HOME_SERVER_ID: "1505540430110920764"
PUBLIC_STAFF_ROLE_ID: "1505546268020310117"
PUBLIC_HONORARY_MEMBER_ROLE_ID: "1505546306721026068"
PUBLIC_SPECIAL_BOARD_OF_DIRECTORS_ROLE_ID: "1505546372726788126"
PUBLIC_BOARD_OF_DIRECTORS_ROLE_ID: "1505546412484726804"
PUBLIC_SUB_BOARD_OF_DIRECTORS_ROLE_ID: "1505546443392422010"
PUBLIC_BOT_ID: "1505544379639660745"
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
BOT_SECRET: ${{ secrets.BOT_SECRET }}
BOT_REDIRECT_URL: http://localhost:3000/auth
DATABASE_URL: ${{ secrets.DATABASE_URL }}
jobs:
container:
name: Container
runs-on: ubuntu-latest
if: github.event_name == 'push' || (github.event_name == 'pull_request_target' && github.event.repository.fork) || (github.event_name == 'pull_request' && !github.event.repository.fork)
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Container
uses: ./.github/workflows/setup
typecheck:
name: Typecheck
runs-on: ubuntu-latest
needs: ["container"]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Container
uses: ./.github/workflows/setup
- name: Typecheck
working-directory: ./docker/
run: |
docker compose exec app sudo scripts/setup.sh
docker compose exec app sudo bun run typecheck
build:
name: Build
runs-on: ubuntu-latest
needs: ["typecheck"]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Container
uses: ./.github/workflows/setup
- name: Build
working-directory: ./docker/
run: |
docker compose exec app sudo scripts/setup.sh
docker compose exec app sudo bun run build
lint:
name: Lint
runs-on: ubuntu-latest
needs: ["typecheck"]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Container
uses: ./.github/workflows/setup
- name: Lint
working-directory: ./docker/
run: |
docker compose exec app sudo scripts/setup.sh
docker compose exec app sudo bun run lint
test:
name: Test
runs-on: ubuntu-latest
needs: ["typecheck"]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Container
uses: ./.github/workflows/setup
- name: Test
working-directory: ./docker/
run: |
docker compose exec app sudo scripts/setup.sh
docker compose exec app sudo bun run build
docker compose exec app sudo bun run test
devcontainer:
name: Dev Container
runs-on: ubuntu-latest
if: github.event_name == 'push' || (github.event_name == 'pull_request_target' && github.event.repository.fork) || (github.event_name == 'pull_request' && !github.event.repository.fork)
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Lowercase image name
id: img
run: echo "name=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- name: Generate .env
run: printenv > .env
- name: Create distopia-db-store
run: |
docker volume create distopia-db-store
- name: Build
uses: devcontainers/ci@v0.3
with:
cacheFrom: ${{ steps.img.outputs.name }}
push: never
runCmd: |
sudo ./scripts/setup.sh
sudo bun run typecheck
sudo bun run build
sudo bun run lint
sudo bun run test