minor fixes to responsiveness #227
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_TEAM_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| TURBO_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
| TURBO_TEAM: ${{ secrets.VERCEL_TEAM_ID }} | |
| REF: ${{ (github.event_name == 'pull_request' && github.base_ref) || github.ref_name }} | |
| on: | |
| - pull_request_target | |
| - push | |
| jobs: | |
| Checkstyle-Lint-Build: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.repository == 'DevDogs-UGA/Community-Resource-Forum' }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: ariga/setup-atlas@master | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Install dependencies | |
| run: pnpm install --ignore-scripts | |
| - name: Validate Formatting and Linting | |
| run: SKIP_ENV_VALIDATION=true pnpm turbo lint prettier typecheck | |
| - name: Dry Run Project Deployment (for PRs) | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: | | |
| SKIP_ENV_VALIDATION=true pnpm turbo build | |
| pnpm dlx vercel env pull ${{ env.ENV_CONFIG }} --token=${{ secrets.VERCEL_TOKEN }} .env | |
| pnpm dlx dotenv-cli -- sh -c 'atlas schema apply --config file://migrations/atlas.hcl --env remote --dev-url docker://mysql/8/example --url mysql://$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST:$MYSQL_PORT/$MYSQL_DATABASE --dry-run' | |
| env: | |
| ENV_CONFIG: ${{ (env.REF == 'main' && '--environment=production') || format('--environment=preview --git-branch={0}', env.REF) }} | |
| - name: Deploy Project (for Pushes) | |
| if: ${{ github.event_name == 'push' }} | |
| run: | | |
| pnpm dlx vercel pull ${{ env.ENV_CONFIG }} --yes --git-branch=${{ github.base_ref }} --token=${{ secrets.VERCEL_TOKEN }} | |
| pnpm dlx vercel env pull ${{ env.ENV_CONFIG }} --token=${{ secrets.VERCEL_TOKEN }} .env | |
| pnpm db:generate | |
| pnpm dlx vercel build ${{ env.BUILD_CONFIG }} --token=${{ secrets.VERCEL_TOKEN }} | |
| pnpm dlx vercel deploy ${{ env.BUILD_CONFIG }} --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | |
| pnpm dlx dotenv-cli -- sh -c 'atlas schema apply --config file://migrations/atlas.hcl --env remote --dev-url docker://mysql/8/example --url mysql://$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST:$MYSQL_PORT/$MYSQL_DATABASE --auto-approve' | |
| env: | |
| ENV_CONFIG: ${{ (env.REF == 'main' && '--environment=production') || format('--environment=preview --git-branch={0}', env.REF) }} | |
| BUILD_CONFIG: ${{ (env.REF == 'main' && '--prod') || ' ' }} |