Skip to content

Merge pull request #170 from DenizUgur/expose-csvs #33

Merge pull request #170 from DenizUgur/expose-csvs

Merge pull request #170 from DenizUgur/expose-csvs #33

Workflow file for this run

name: Publication to GitHub Pages
on:
push:
branches:
- dev
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Use Node.js 8
uses: actions/setup-node@v2
with:
node-version: '8'
- run: npm install -g browserify
- run: npm install
- run: NODE_ENV=production browserify -t brfs src/app.js -o dist/js/bundle.js
- name: Move index.html
run: |
mv index.html dist/index.html
sed -i 's/dist//g' dist/index.html
- name: Combine CSVs
shell: python
run: |
import csv, json, glob
ignore = ['specifications', 'unlisted', 'knownduplicates', '-qt', 'textualcontent']
boxes = []
for file in glob.glob('CSV/*.csv'):
if any([i in file for i in ignore]):
continue
with open(file, 'r') as f:
boxes.extend(csv.DictReader(f))
with open("dist/boxes.json", 'w') as f:
json.dump(boxes, f)
- name: Deploy to GitHub Pages
#Note: if the repository name changes, the condition has to change
if: ${{ github.repository == 'mp4ra/mp4ra.github.io' }}
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
folder: dist
branch: master # deploying branch
git-config-name: 'github-actions[bot]'
git-config-email: 'github-actions[bot]@users.noreply.github.com'