Skip to content

Commit

Permalink
chore: cloudflare CI things
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdef1cafe committed Feb 28, 2023
1 parent 71c5483 commit 428a893
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ jobs:
call-cloudflare-workflow:
name: Call
uses: ./.github/workflows/cloudflare.yml
secrets: inherit # pass org/repo secrets to the called workflow
needs: [install-and-cache]
20 changes: 14 additions & 6 deletions .github/workflows/cloudflare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ on:

jobs:
deploy:
if: contains(fromJSON('["develop", "release", "yeet", "main", "private"]'), ${{ github.ref_name }})
env:
# head_ref is current branch name
# https://docs.github.com/en/actions/learn-github-actions/contexts#example-contents-of-the-github-context
GITHUB_BRANCH_NAME: ${{ github.head_ref }}
if: contains(fromJSON('["develop", "release", "yeet", "main", "private"]'), ${{ github.head_ref }})
runs-on: size-bertha
permissions:
contents: read
deployments: write
name: Build
env:
# ref_name is branch name https://docs.github.com/en/actions/learn-github-actions/contexts#example-contents-of-the-github-context
GITHUB_BRANCH_NAME: ${{ github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -20,6 +21,14 @@ jobs:
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Cache
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache/Cypress
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Yarn Install
run: yarn install --frozen-lockfile
- name: Build
Expand All @@ -29,7 +38,6 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: web-29e # e.g. 'my-project'
projectName: web # e.g. 'my-project'
directory: build # e.g. 'dist'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.GITHUB_BRANCH_NAME }}
2 changes: 1 addition & 1 deletion scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const createDraftPR = async (): Promise<void> => {
const { messages } = await getCommits('release')
// TODO(0xdef1cafe): parse version bump from commit messages
const nextVersion = await getNextReleaseVersion('minor')
const title = `chore: release ${nextVersion} [DO NOT MERGE]`
const title = `chore: release ${nextVersion}`
const command = `gh pr create --draft --base "main" --title "${title}" --body "${messages}"`
console.log(chalk.green('Creating draft PR...'))
await pify(exec)(command)
Expand Down

0 comments on commit 428a893

Please sign in to comment.