Merge pull request #141 from tsg-ut/dependabot/npm_and_yarn/biomejs/b… #308
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: Test and Deploy | |
| on: | |
| push: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint | |
| run: npx biome lint | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Format | |
| run: npx biome format | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check compilation errors on TypeScript files | |
| run: npx tsc --noEmit && npx tsc --project functions --noEmit | |
| - name: Generate dist | |
| run: npm run build | |
| - name: Setup Firebase CLI | |
| run: npm install -g firebase-tools | |
| - name: Run Test | |
| run: npm test | |
| deploy_firebase: | |
| name: Deploy Firebase Configurations | |
| needs: [lint, format, test] | |
| # if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
| # Disabled temporary | |
| if: ${{ false }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@master | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Create virtual environment and install Python dependencies | |
| run: | | |
| cd python-functions | |
| python3.13 -m venv venv | |
| source venv/bin/activate | |
| pip install -r requirements.txt | |
| - name: Restore .env file from secrets | |
| run: echo "${{secrets.FUNCTIONS_DOTENV}}" > functions/.env | |
| - name: Deploy to Firebase | |
| run: | | |
| cd python-functions | |
| source venv/bin/activate | |
| cd .. | |
| npx firebase deploy --except hosting --token "$FIREBASE_TOKEN" | |
| env: | |
| FIREBASE_TOKEN: "${{ secrets.FIREBASE_TOKEN }}" | |
| ESLINT_USE_FLAT_CONFIG: "false" | |
| deploy_hosting: | |
| name: Deploy Firebase Hosting | |
| needs: [lint, format, test] | |
| if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - run: npm ci | |
| - uses: FirebaseExtended/action-hosting-deploy@v0 | |
| with: | |
| repoToken: "${{ secrets.GITHUB_TOKEN }}" | |
| firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ARC_CODEGOLF }}" | |
| channelId: live | |
| projectId: arc-codegolf |