Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
CGQAQ committed Nov 30, 2023
1 parent 1fc7aec commit 19ffad6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 40 deletions.
42 changes: 4 additions & 38 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,48 +31,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Detect package manager
id: detect-package-manager
- name: Build
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Restore cache
uses: actions/cache@v3
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
./nx run --output-style=stream-without-prefixes editor:install
./nx run --output-style=stream-without-prefixes editor:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./out
path: ./editor/out

# Deployment job
deploy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v4

- name: Build Server
run: cargo build --release --manifest-path=local_server/Cargo.toml
run: ./nx build local_server

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
Expand Down
2 changes: 1 addition & 1 deletion local_server/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"options": {
"cwd": "local_server",
"commands": [
"cargo build"
"cargo build --release"
]
}
},
Expand Down

0 comments on commit 19ffad6

Please sign in to comment.