Skip to content

Commit

Permalink
feat: self-hosted gha-runners (#496)
Browse files Browse the repository at this point in the history
Signed-off-by: Promise <[email protected]>
  • Loading branch information
promise authored Nov 22, 2023
1 parent dddf122 commit 121e40f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 37 deletions.
39 changes: 4 additions & 35 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:

jobs:
build:
name: Test build
runs-on: ubuntu-latest
name: ${{ github.ref == 'refs/heads/main' && 'Publish' || 'Test build' }}
runs-on: self-hosted

if: ${{ github.event_name == 'pull_request' }}

Expand All @@ -30,44 +30,13 @@ jobs:
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Test worker build
uses: cloudflare/wrangler-action@5e8484995321734668f14981c316aa9188d76ed1 # v3.3.2
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
publish: false

publish:
name: Publish
runs-on: ubuntu-latest

if: ${{ github.event_name != 'pull_request' }}

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Set up node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Publish to Worker
- name: ${{ github.ref == 'refs/heads/main' && 'Build ans publish' || 'Test worker build' }}
uses: cloudflare/wrangler-action@5e8484995321734668f14981c316aa9188d76ed1 # v3.3.2
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: ${{ github.ref == 'refs/heads/main' && 'deploy' || 'deploy --dry-run' }}
3 changes: 1 addition & 2 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
runs-on: self-hosted

steps:
- name: Checkout repository
Expand All @@ -26,7 +26,6 @@ jobs:
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down

0 comments on commit 121e40f

Please sign in to comment.