Skip to content

Commit

Permalink
Add github upload workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Dec 10, 2024
1 parent 4187ae7 commit 84f67ab
Show file tree
Hide file tree
Showing 4 changed files with 542 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Deploy

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"

steps:
- uses: "actions/checkout@v4"

- uses: actions/setup-node@v4
with:
node-version: "20"

- uses: pnpm/action-setup@v2
with:
version: "9.12.3"

- run: pnpm install
- run: pnpm build

- run: |
if [[ -n "$(git status --porcelain src/)" ]]; then
echo "Found changes in src/ directory after build"
exit 1
fi
- if: github.ref == 'refs/heads/main'
uses: "google-github-actions/auth@v2"
with:
project_id: c7e-prod
workload_identity_provider: "projects/276773611885/locations/global/workloadIdentityPools/github/providers/presets-repo"

- if: github.ref == 'refs/heads/main'
uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: "configs"
destination: "c7e-prod-static/presets"
parent: false
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,7 @@ lcov.info

account.json
keystore.json

dist/
node_modules/
.env
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "module",
"scripts": {
"build:configs": "tsx scripts/generate-configs.ts && prettier --write src/generated/controller-configs.ts",
"build": "pnpm build:configs && tsup --dts-resolve",
"build": "pnpm build:configs && pnpm build:assets && tsup --dts-resolve",
"fetch:erc20": "tsx scripts/fetch-erc20.ts && prettier --write src/generated/erc20-metadata.ts",
"format": "prettier --write \"src/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\""
Expand Down
Loading

0 comments on commit 84f67ab

Please sign in to comment.