Merge pull request #133 from HerrZatacke/develop #145
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/checkout@v3.3.0 | |
- name: Setup node π» | |
uses: actions/setup-node@v3.6.0 | |
with: | |
node-version: '16.x' | |
cache: 'npm' | |
- 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/tag-exists-action@v1.2.0 | |
with: | |
tag: ${{ env.RELEASE_VERSION }} | |
- name: Install npm dependencies π | |
if: steps.checkTag.outputs.exists == 'false' | |
run: 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 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/github-pages-deploy-action@v4.4.1 | |
if: steps.checkTag.outputs.exists == 'false' | |
with: | |
branch: gh-pages | |
folder: dist | |
- name: Create Release π π₯³ | |
uses: softprops/action-gh-release@v1 | |
if: steps.checkTag.outputs.exists == 'false' | |
with: | |
tag_name: ${{ env.RELEASE_VERSION }} | |
name: Version ${{ env.RELEASE_VERSION }} | |
files: data_w.zip |