Build Providers #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Providers | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [build-project] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: CI | |
permissions: | |
contents: read | |
deployments: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9.14.4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Install packages | |
run: pnpm install --frozen-lockfile | |
- name: Build provider library | |
run: | | |
pnpm run build | |
# Make sure the build runs inside the 'providers' submodule directory | |
working-directory: providers | |
- name: Build provider umd module | |
run: webpack --config build-umd-module.js | |
working-directory: ${{ github.workspace }} | |
- name: Upload providers umd module to API | |
run: | | |
curl -X PUT \ | |
-H "X-Custom-Auth-Key: $MY_KEY" \ | |
--data-binary @provider.min.js \ | |
https://r2-api.mayor.workers.dev/provider.min.js | |
working-directory: dist | |
env: | |
MY_KEY: ${{ secrets.MY_KEY }} |