Skip to content

change build settings #44

change build settings

change build settings #44

Workflow file for this run

name: Transformation Quest Build & Deploy
on:
push:
branches:
- develop
workflow_dispatch:
env:
NODE_VERSION: 16.x
jobs:
build:
name: Build npm project
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
# Install and connect to VPN
- name: Install OpenConnect
run: sudo apt-get update && sudo apt-get install openconnect
- name: Connect to VPN
run: echo ${{ secrets.FIELDDAY_VPN_PASSWORD }} | sudo openconnect --protocol=gp -u ${{ secrets.FIELDDAY_VPN_USERNAME }} --passwd-on-stdin soe.vpn.wisc.edu &
# Setup repo
- name: Checkout repository
uses: actions/checkout@v3
- name: Extract branch name
shell: bash
run: echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_ENV
- name: Extract version name
shell: bash
run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/} | sed 's/\//_/g')" >> $GITHUB_ENV
# Build
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Install Package
run: npm install
- name: Remove old builds
run: rm -rf web/build
- name: Build
# TODO: find/define best build script for our purposes
run: cd web && npm run build-fieldday-develop
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: transformation_quest_${{ env.VERSION }}
path: web/build
- name: Upload to web server via rsync
uses: burnett01/rsync-deployments@5.2
with:
switches: -avzr --delete
path: web/build/*
remote_path: ${{ secrets.DEPLOY_DIR }}/${{ env.BRANCH }}
remote_host: ${{ secrets.FIELDDAY_WISC_EDU_DEPLOY_HOST }}
remote_user: ${{ secrets.FIELDDAY_WISC_EDU_DEPLOY_USER }}
remote_key: ${{ secrets.FIELDDAY_WISC_EDU_DEPLOY_KEY }}