deploy-vue #67
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: deploy-vue | |
on: | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: 'Reason for deploying Vue app' | |
required: true | |
default: 'Manual deployment' | |
jobs: | |
deploy-vue: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "🎉 The job was triggered by a ${{ github.event_name }} on commit ${{ github.SHA }}" | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Upload to DO | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.DO_SSH_KEY }} | |
name: id_rsa | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- run: npm install -g [email protected] # version? 1.22.17 -> 1.22.19 current | |
- run: npm install -g [email protected] # version? 3.22.1 -> 6.6.2 current | |
- run: npm install -g [email protected] # version? 4.5.5 -> 5.1.3 current | |
- name: Build | |
run: | | |
lerna bootstrap | |
printf "${{ secrets.VUE_ENV }}" > ./packages/vue/.env.production | |
cd ./packages/express | |
yarn remove @types/jest | |
cd ../vue | |
yarn build | |
- name: Deploy /vue | |
run: | | |
vcount=$(ssh ${{ secrets.DO_USERNAME }}@eduquilt.com ls -1v /home/skuilder/dist/vue/ | tail -n1) | |
ssh ${{ secrets.DO_USERNAME }}@eduquilt.com mkdir /home/skuilder/dist/vue/$(($vcount+1)) | |
rsync -rl ./packages/vue/dist/ ${{ secrets.DO_USERNAME }}@eduquilt.com:/home/skuilder/dist/vue/$(($vcount+1)) | |
ssh ${{ secrets.DO_USERNAME }}@eduquilt.com ln -sfn /home/skuilder/dist/vue/$(($vcount+1)) /home/skuilder/www | |
# todo: toss a buildinfo.md file into the (vcount+1) folder, linking PR, listing time, logging build errors, etc |