fix: version display with vite #270
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |