Skip to content

Firstrefactor

Firstrefactor #25

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run build
run: pnpm run build
- name: Uploading production-ready build files
uses: actions/upload-artifact@v2
with:
name: production-files
path: ./dist
data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
sparse-checkout: |
scripts/build_database.py
sparse-checkout-cone-mode: false
- uses: actions/checkout@v3
with:
sparse-checkout: |
data
repository: jacobfilik/XASDataLibrary
path: xdidata
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install xraylarch
- name: list
run: |
ls
- name: Build db
run: |
python scripts/build_database.py
- name: Uploading data
uses: actions/upload-artifact@v2
with:
name: data-files
path: ./xdidata/data
deploy:
name: Deploy
needs: [build, data]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Downloading artifact
uses: actions/download-artifact@v2
with:
name: production-files
path: ./dist
- name: Downloading data
uses: actions/download-artifact@v2
with:
name: data-files
path: ./dist/xdidata
- name: Deploying to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist