Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Refactor code: Remove unnecessary return statements #29

Refactor code: Remove unnecessary return statements

Refactor code: Remove unnecessary return statements #29

# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets the GITHUB_TOKEN permissions 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
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: './mini-mecha-code'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: '**/package-lock.json' # THIS PATTERN did the trick for me.
- name: Install dependencies
run: npm install
- name: Generate Langium
run: npm run langium:generate
- name: Build
run: npm run build:web
- name: Copy required files
run: |
mkdir github-pages-output
mv static github-pages-output
mv syntaxes github-pages-output
mv language-configuration.json github-pages-output/language-configuration.json
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload dist repository
path: ./mini-mecha-code/github-pages-output
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2