Skip to content

Merge pull request #18 from aolkin/dependabot/npm_and_yarn/semver-5.7.2 #59

Merge pull request #18 from aolkin/dependabot/npm_and_yarn/semver-5.7.2

Merge pull request #18 from aolkin/dependabot/npm_and_yarn/semver-5.7.2 #59

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Build and Deploy Latest
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build the site
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# container:
# image: node:18
# options: --user root
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v3
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine packager manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Restore cache
uses: actions/cache@v3
with:
path: |
dist
.nuxt
key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }}
restore-keys: |
${{ runner.os }}-nuxt-build-
- run: mv tsconfig.json tsconfig.unused
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Vite static site build
run: ${{ steps.detect-package-manager.outputs.manager }} build
# - uses: borales/actions-yarn@v3.0.0
# with:
# cmd: install # will run `yarn install` command
# - uses: borales/actions-yarn@v3.0.0
# with:
# cmd: build # will run `yarn build` command
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./dist
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1