Skip to content

v1.7.23

v1.7.23 #1707

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Deploy to Pages
on:
push:
branches:
- devel
release:
types: [published]
workflow_dispatch:
# Allow one concurrent deployment
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch:
- main
- devel
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
- run: npm install
- run: npm list
- run: npm list --all
- run: npm run build
- run: npm run typecheck
- run: npm run lint
- run: |
mkdir ./dist/"${{ matrix.branch }}"
mv ./package-lock.json ./dist/mbs.js ./dist/mbs.js.map ./static/** ./dist/"${{ matrix.branch }}"/
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.branch }}
path: ./dist
deploy:
needs: [build]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
name: Download previous release artifacts
with:
repository: bananarama92/MBS-Artifacts
path: MBS-Artifacts
token: ${{ secrets.MBS_ARTIFACTS_TOKEN }}
- uses: actions/download-artifact@v4
with:
path: MBS-Artifacts/artifacts
- run: |
mv MBS-Artifacts/artifacts/artifact-main/main MBS-Artifacts/artifacts/main
mv MBS-Artifacts/artifacts/artifact-devel/devel MBS-Artifacts/artifacts/devel
- name: Push new release artifacts to the MBS release archive
if: github.event_name == 'release'
run: |
MBS_HASH=$(git rev-parse HEAD)
cd MBS-Artifacts
mkdir artifacts/${{ github.event.release.tag_name }}
cp -r artifacts/main/** artifacts/${{ github.event.release.tag_name }}/
git add artifacts/${{ github.event.release.tag_name }}/*
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "MAINT: Add MBS ${{ github.event.release.tag_name }} release artifacts" -m "Last commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
git push
- name: Define the latest MBS release
run: |
TAG=$(git describe --abbrev=0 --tags)
echo "New tag: $TAG"
mkdir artifacts
cp -r MBS-Artifacts/artifacts/"$TAG" artifacts/main
cp -r MBS-Artifacts/artifacts/devel artifacts/devel
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './artifacts'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Attach release artifacts to GitHub release
if: github.event_name == 'release'
uses: AButler/upload-release-assets@v3.0
with:
files: 'MBS-Artifacts/artifacts/${{ github.ref_name }}/*.{js,js.map,json}'
repo-token: ${{ secrets.GITHUB_TOKEN }}