diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c091caed5..36766bd79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,15 @@ name: ๐Ÿงช CI -on: [push, pull_request] + +on: + pull_request: + push: + branches: [main] permissions: {} jobs: build: - name: Build + name: ๐Ÿ—๏ธ Build runs-on: ubuntu-latest steps: - name: Checkout repository @@ -23,7 +27,7 @@ jobs: path: out/index.html retention-days: 1 test: - name: Test + name: ๐Ÿ”ฌ Test runs-on: ubuntu-latest steps: - name: Checkout repository @@ -36,3 +40,27 @@ jobs: node-version: 20 - run: npm ci - run: npm test + + eslint: + name: ๐Ÿ” ESLint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + - run: npm ci + - run: npx eslint --format gha + + prettier: + name: ๐ŸŽจ Prettier + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + - run: npm ci + - run: npx prettier --check . diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8abcf27bf..0d2210dbd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -41,16 +41,9 @@ jobs: # Don't deploy on push if this is a fork if: ${{ github.event_name == 'workflow_dispatch' || github.repository == 'openfrontio/OpenFrontIO' }} # Use different logic based on event type - name: ${{ - github.event_name == 'push' - && (github.ref_name == 'main' && 'openfront.dev' - || format('{0}.openfront.dev', github.ref_name)) - || inputs.target_subdomain && format('{0}.{1}', inputs.target_subdomain, inputs.target_domain) - || inputs.target_domain - || 'openfront.dev' - }} + name: Deploy to ${{ inputs.target_domain || 'openfront.dev' }} runs-on: ubuntu-latest - environment: ${{ inputs.target_domain == 'openfront.io' && 'prod' || '' }} + environment: ${{ inputs.target_domain == 'openfront.io' && 'prod' || 'staging' }} env: DOMAIN: ${{ inputs.target_domain || 'openfront.dev' }} SUBDOMAIN: ${{ github.event_name == 'push' && github.ref_name || inputs.target_subdomain || 'main' }} diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml deleted file mode 100644 index 8eb55c70d..000000000 --- a/.github/workflows/eslint.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: ๐Ÿ” ESLint - -on: - pull_request: - push: - branches: [main] - -permissions: {} - -jobs: - eslint: - name: Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "npm" - - run: npm ci - - run: npx eslint --format gha diff --git a/.github/workflows/pr-description.yml b/.github/workflows/pr-description.yml index e96b0b826..864bca7a8 100644 --- a/.github/workflows/pr-description.yml +++ b/.github/workflows/pr-description.yml @@ -8,7 +8,7 @@ permissions: {} jobs: validate-description: - name: Check + name: Validate Description runs-on: ubuntu-latest steps: - uses: actions/github-script@v7 diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml deleted file mode 100644 index 4d0e1327e..000000000 --- a/.github/workflows/prettier.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: ๐ŸŽจ Prettier - -on: - pull_request: - push: - branches: [main] - -permissions: {} - -jobs: - prettier: - name: Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "npm" - - run: npm ci - - run: npx prettier --check .