fix type casting, remove dotenv from bundle #33
This file contains 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/CD | |
on: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
branches: | |
- 'master' | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Node & NPM | |
uses: ./.github/actions/setup | |
- name: Lint | |
run: npx biome ci . | |
ts: | |
name: TS | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Node & NPM | |
uses: ./.github/actions/setup | |
- name: TS | |
run: npm run tsc | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: | |
- ts | |
outputs: | |
bundle-cache-hit: ${{ steps.cache-bundle.outputs.cache-hit }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Node & NPM | |
id: setup | |
uses: ./.github/actions/setup | |
- name: Build App Bundle | |
run: npm run build | |
- name: Cache App Bundle | |
id: cache-bundle | |
uses: actions/cache@v4 | |
with: | |
path: dist | |
key: ${{ runner.os }}-${{steps.setup.outputs.node-version}}-bundle-${{hashFiles('dist/**')}} | |
- name: Upload App Bundle | |
if: steps.cache-bundle.outputs.cache-hit != 'true' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bundle | |
path: dist/ | |
retention-days: 30 | |
deploy: | |
environment: | |
name: production | |
url: https://sofash.vorant94.workers.dev | |
name: Deploy | |
runs-on: ubuntu-latest | |
needs: | |
- lint | |
- ts | |
- build | |
if: | | |
github.event_name == 'push' && | |
github.ref == 'refs/heads/master' && | |
needs.build.outputs.bundle-cache-hit != 'true' | |
concurrency: | |
group: deploy | |
cancel-in-progress: false | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Node & NPM | |
id: setup | |
uses: ./.github/actions/setup | |
- name: Download App Bundle | |
uses: actions/download-artifact@v4 | |
with: | |
name: bundle | |
path: dist/ | |
- name: Deploy Bundle | |
run: npx wrangler deploy | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} |