Merge pull request #203 from HerrZatacke/develop #205
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: Build 𧱠and Deploy π³ | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout π³ | |
uses: actions/[email protected] | |
- name: Setup node π» | |
uses: actions/[email protected] | |
with: | |
node-version: '20.x' | |
- name: Add release version to environment variables π | |
run: | | |
node -e "console.log('RELEASE_VERSION=' + require('./package.json').version)" >> $GITHUB_ENV | |
- name: Check if tag already exists π· | |
id: checkTag | |
uses: mukunku/[email protected] | |
with: | |
tag: ${{ env.RELEASE_VERSION }} | |
- name: Install npm dependencies π | |
if: steps.checkTag.outputs.exists == 'false' | |
run: | | |
rm package-lock.json | |
npm cache clear -f | |
npm install | |
- name: Create config.json π | |
if: steps.checkTag.outputs.exists == 'false' | |
env: | |
CONFIG_JSON: ${{ secrets.CONFIG_JSON }} | |
run: echo $CONFIG_JSON | base64 --decode > config.json | |
- name: Build 𧱠| |
if: steps.checkTag.outputs.exists == 'false' | |
run: | | |
npm run lint | |
npm run build | |
- name: Create data_w.zip for release π | |
if: steps.checkTag.outputs.exists == 'false' | |
run: | | |
cd release | |
zip -r ../data_w.zip * | |
cd .. | |
- name: Deploy to GitHub-Pages π³ | |
uses: JamesIves/[email protected] | |
if: steps.checkTag.outputs.exists == 'false' | |
with: | |
branch: gh-pages | |
folder: dist | |
- name: Create Release π π₯³ | |
uses: softprops/[email protected] | |
if: steps.checkTag.outputs.exists == 'false' | |
with: | |
tag_name: ${{ env.RELEASE_VERSION }} | |
name: Version ${{ env.RELEASE_VERSION }} | |
files: data_w.zip |