Skip to content

fix GH actions context #18

fix GH actions context

fix GH actions context #18

Workflow file for this run

name: 'Test'
on:
pull_request:
branches:
- main
workflow_call:
workflow_dispatch:
jobs:
test:
name: 'Unit Tests'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20 ]
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Setup Node'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: 'Install Dependencies'
run: npm ci
- name: 'Test Node.js-${{ matrix.node-version }}'
run: npm test
env:
VITE_MODE: 'TEST'
build:
name: 'Build'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20 ]
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Setup Node'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: 'Install Dependencies'
run: npm ci
- name: 'build'
run: npm run build
test_image_builds:
name: 'Build Image'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Docker meta'
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/the-manifest-game
- name: 'Build'
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
context: .
push: false
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
lint:
name: 'Lint'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Setup Node'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: 'Install Dependencies'
run: npm ci
- name: 'Lint Source'
run: npm run lint