Skip to content

Merge pull request #60 from Testausserveri/dependabot/npm_and_yarn/ba… #274

Merge pull request #60 from Testausserveri/dependabot/npm_and_yarn/ba…

Merge pull request #60 from Testausserveri/dependabot/npm_and_yarn/ba… #274

Workflow file for this run

name: React app deployement
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Restore CI Cache
uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-16-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
if: ${{ !steps.cache.outputs.cache-hit }}
run: yarn --frozen-lockfile
- run: |
npm ci
npm run build
echo "matikkaeditori.fi" >> dist/CNAME
echo "VERSION: " >> dist/VERSION
echo $(git rev-parse --short "$GITHUB_SHA") >> dist/VERSION
git config user.name github-actions
git config user.email [email protected]
git --work-tree dist add --all
git commit -m "Automatic React build & deploy"
git push origin HEAD:gh-pages --force