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

update action

update action #6

# 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: Setup Pages
uses: actions/configure-pages@v3
- name: Archive artifact
shell: sh
if: runner.os == 'Linux'
run: |
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
--exclude=node_modules \
--exclude=bin \
--exclude=example \
--exclude=generated \
--exclude=scripts \
--exclude=src \
.
env:
INPUT_PATH: "./mini-mecha-code/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload dist repository
path: ${{ runner.temp }}/artifact.tar
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2