Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v6.5.0
with:
node-version: 22
- uses: calcit-lang/setup-calcit@v1.5.1
Expand All @@ -24,16 +24,41 @@ jobs:
set -euo pipefail
corepack enable
yarn install --immutable
caps --ci
caps --strict --ci
caps verify --toolchain
- name: Validate Calcit
run: |
set -euo pipefail
calcit calcit.cirru edit format
git diff --exit-code -- calcit.cirru
calcit calcit.cirru --check-only
calcit calcit.cirru fix --workflow strict --verify
- name: Select CDN path
id: assets
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
prefix="${GITHUB_REPOSITORY}/"
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
prefix="${GITHUB_REPOSITORY}/pr/${PR_NUMBER}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}/"
fi
base_url="https://cos-sh.tiye.me/${prefix}"
echo "VITE_BASE_URL=$base_url" >> "$GITHUB_ENV"
echo "prefix=$prefix" >> "$GITHUB_OUTPUT"
echo "base-url=$base_url" >> "$GITHUB_OUTPUT"
- name: Build
run: yarn build
- name: Upload and verify frontend assets
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
uses: worktools/cos-upload-action@v1.3.0
with:
source-dir: dist
bucket: ${{ secrets.COS_BUCKET }}
region: ap-shanghai
prefix: ${{ steps.assets.outputs.prefix }}
public-base-url: ${{ steps.assets.outputs.base-url }}
secret-id: ${{ secrets.COS_SECRET_ID }}
secret-key: ${{ secrets.COS_SECRET_KEY }}
- name: Deploy to server
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
id: deploy
Expand Down
4 changes: 2 additions & 2 deletions deps.cirru
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{} (:calcit-version |0.44.0)
:version |0.0.1
:dependencies $ {} (|Respo/respo.calcit |0.19.12)
|Respo/respo-ui.calcit |0.15.6
:dependencies $ {} (|Respo/respo.calcit |0.19.13)
|Respo/respo-ui.calcit |0.15.7
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "ClojureScript workflow using Calcit Editor",
"main": "index.js",
"scripts": {
"build": "calcit calcit.cirru js && vite build --base=./",
"build": "calcit calcit.cirru js && vite build --base=${VITE_BASE_URL:-./}",
"watch": "calcit calcit.cirru -w"
},
"repository": {
Expand Down