46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: Build and deploy website
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: host
|
|
|
|
steps:
|
|
- name: Setup nvm
|
|
run: |
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
|
export NVM_DIR="$HOME/.nvm"
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
- name: Setup Node
|
|
run: nvm install latest && nvm use latest && npm install -g pnpm
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
- name: Build
|
|
run: pnpm build
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v3 # Deprecated but v4+ is not supported for GHES
|
|
with:
|
|
path: dist
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: dist
|
|
- name: Move files to server
|
|
run: |
|
|
cp -r dist/* /var/www/beta.martials.no
|