Martin Berg Alstad cf17796009
Some checks failed
Build and deploy website / build (push) Failing after 2s
Build and deploy website / deploy (push) Failing after 3s
Replaced $HOME with path
2024-09-28 12:42:35 +02:00

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="/opt/gitea_runner/.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