Skip to content

Merge pull request #13 from MineralFish/dependabot/npm_and_yarn/svelt… #121

Merge pull request #13 from MineralFish/dependabot/npm_and_yarn/svelt…

Merge pull request #13 from MineralFish/dependabot/npm_and_yarn/svelt… #121

Workflow file for this run

name: build-site
on:
push:
branches-ignore:
- build
workflow_dispatch:
env:
WORK_DIR: ''
jobs:
build-site:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref_name }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: built-site
path: dist/
- name: Checkout to build
uses: actions/checkout@v2
with:
ref: 'build'
- name: Create and go to branch folder if needed
run: |
mkdir -p branches/${{ github.ref_name }}
echo "WORK_DIR=branches/${{ github.ref_name }}/" >> $GITHUB_ENV
if: github.ref_name != 'master'
- name: Clear out things
run: .|
rm -rf ./${{ env.WORK_DIR }}assets
rm -rf ./${{ env.WORK_DIR }}favicon.png
rm -rf ./${{ env.WORK_DIR }}global.css
rm -rf ./${{ env.WORK_DIR }}index.html
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: built-site
path: ./${{ env.WORK_DIR }}
- name: Commit and push
uses: EndBug/add-and-commit@v8
with:
message: Build branch ${{ github.ref_name }}
push: true