minor tweaks for consistency with other templates
This commit is contained in:
+26
-6
@@ -32,10 +32,30 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- uses: actions/setup-node@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Detect package manager
|
||||||
|
id: detect-package-manager
|
||||||
|
run: |
|
||||||
|
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
|
||||||
|
echo "::set-output name=manager::yarn"
|
||||||
|
echo "::set-output name=command::install"
|
||||||
|
echo "::set-output name=runner::yarn"
|
||||||
|
exit 0
|
||||||
|
elif [ -f "${{ github.workspace }}/package.json" ]; then
|
||||||
|
echo "::set-output name=manager::npm"
|
||||||
|
echo "::set-output name=command::ci"
|
||||||
|
echo "::set-output name=runner::npx --no-install"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Unable to determine packager manager"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: "16"
|
||||||
|
cache: ${{ steps.detect-package-manager.outputs.manager }}
|
||||||
cache-dependency-path: ${{ env.BUILD_PATH }}/package-lock.json
|
cache-dependency-path: ${{ env.BUILD_PATH }}/package-lock.json
|
||||||
- run: npm install && npm run build
|
- run: npm install && npm run build
|
||||||
working-directory: ${{ env.BUILD_PATH }}
|
working-directory: ${{ env.BUILD_PATH }}
|
||||||
@@ -44,12 +64,12 @@ jobs:
|
|||||||
path: ${{ env.BUILD_PATH }}/dist
|
path: ${{ env.BUILD_PATH }}/dist
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: build
|
|
||||||
name: Deploy
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
environment:
|
||||||
name: github-pages
|
name: github-pages
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Deploy
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
id: deployment
|
id: deployment
|
||||||
|
|||||||
Reference in New Issue
Block a user