Skip to content

Commit

Permalink
feat: rework deployment scripts to match freeway
Browse files Browse the repository at this point in the history
release-please is currently deploying all merges to main to production and untangling the existing build script is exhausting - we have a simpler system in Freeway, so I've taken the opportunity to port that over here.
  • Loading branch information
travis committed Nov 26, 2024
1 parent 4e1d1b3 commit 0f37bcb
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 98 deletions.
16 changes: 16 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Test
description: 'Setup and test'

runs:
using: "composite"
steps:
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: 20
cache: 'pnpm'
- run: pnpm test:w3link-edge-gateway
shell: bash
98 changes: 0 additions & 98 deletions .github/workflows/edge-gateway-link.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- main
name: Release
jobs:
release-staging:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
- name: Deploy to Staging
uses: cloudflare/wrangler-action@v3
env:
ENV: 'staging'
SENTRY_TOKEN: ${{secrets.SENTRY_TOKEN}}
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }}
with:
apiToken: ${{secrets.CF_GATEWAY_TOKEN }}
workingDirectory: 'packages/edge-gateway-link'
environment: 'staging'
release-production:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node
- uses: actions/checkout@v3
- uses: ./.github/actions/test
- name: Deploy to Production
uses: cloudflare/wrangler-action@v3
env:
ENV: 'production' # inform the build process what the env is
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }}
with:
apiToken: ${{ secrets.CF_GATEWAY_TOKEN }}
workingDirectory: 'packages/edge-gateway-link'
environment: 'production'
if: ${{ steps.release.outputs.release_created }}

16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test

0 comments on commit 0f37bcb

Please sign in to comment.