Skip to content

Build and deploy

Build and deploy #188

name: Build and deploy
on:
push:
tags: v[1-9]+.[0-9]+.[0-9]+
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Actions/checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Actions/setup-node
uses: actions/setup-node@v4
with:
cache: 'npm'
node-version: '20.x'
- name: Install dependencies
run: npm ci
- name: Create env file
run: |
touch .env
echo VITE_LASTFM_APIKEY=${{ secrets.LASTFM_APIKEY }} >> .env
echo VITE_LASTFM_SECRET=${{ secrets.LASTFM_SECRET }} >> .env
echo VITE_FANART_APIKEY=${{ secrets.FANART_APIKEY }} >> .env
- name: NPM build
run: npm run build --if-present
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './dist'
production-branch: main
production-deploy: true
deploy-message: 'Deploy from GitHub Actions'
enable-pull-request-comment: false
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1