This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
Merge pull request #35 from wmde/feat/deprecation-notice-in-readme-20… #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: Build and Deploy to Toolforge | |
on: | |
push: | |
branches: | |
- main | |
- gh-actions/** | |
jobs: | |
build-deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setting up Node.js v10 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 10.x | |
- name: Installing dependencies | |
run: npm ci | |
- name: Building Vue.js app | |
run: npm run build | |
- name: Preparing code to sync | |
run: npm prune --production | |
- name: Syncing code to Toolforge | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
source: "./" | |
target: "www/js" | |
rm: true | |
- name: Deploy and restart server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
script: | | |
become connecting-senses rm -rf www | |
cp -rv www ~tools.connecting-senses/ | |
become connecting-senses take www | |
become connecting-senses cp .env www/js/.env | |
become connecting-senses webservice --backend=kubernetes node10 restart |