Skip to content

Commit

Permalink
ci: deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
atty303 committed May 10, 2024
1 parent d1d159a commit 44ee1b4
Showing 1 changed file with 39 additions and 19 deletions.
58 changes: 39 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,57 @@ permissions:
pull-requests: write

jobs:
release-please:
build:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.TOKEN_APP_ID }}
private-key: ${{ secrets.TOKEN_PRIVATE_KEY }}

- uses: google-github-actions/release-please-action@v4
id: release-please
with:
token: ${{ steps.app-token.outputs.token }}

publish:
runs-on: ubuntu-latest
needs: [ release-please ]
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# name: plugin
# path: build/distributions/
#
- uses: actions/create-github-app-token@v1
id: app-token
- uses: oven-sh/setup-bun@v1
- uses: mymindstorm/setup-emsdk@v14

- name: Cache node_modules
uses: actions/cache@v4
with:
app-id: ${{ secrets.TOKEN_APP_ID }}
private-key: ${{ secrets.TOKEN_PRIVATE_KEY }}
path: packages/*/node_modules
key: "${{ runner.os }}-node-modules-${{ hashFiles('bun.lockb') }}"
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
run: bun install --frozen-lockfile
working-directory: packages/driver

- name: Build
run: bun run build
working-directory: packages/driver

- name: Install dependencies
run: bun install --frozen-lockfile
working-directory: packages/web

- name: Build
run: bun run build
working-directory: packages/web

- name: Deploy
# if: ${{ steps.release-please.outputs.release_created }}
run: bun run deploy
working-directory: packages/web
env:
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

0 comments on commit 44ee1b4

Please sign in to comment.