UPD spawndemo #27932
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: UPD spawndemo | |
on: | |
schedule: | |
- cron: "0,30 * * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: check to migrate2composition branch | |
run: | | |
git checkout migrate2composition | |
- name: install tool | |
run: sudo apt install wget gnupg nodejs npm nginx -y | |
- name: setup nginx | |
run: | | |
sudo mkdir -p /var/www/html/ | |
sudo cat /etc/nginx/sites-enabled/default | |
sudo cp ./nginx.conf /etc/nginx/sites-enabled/default | |
sudo service nginx restart | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: setup node | |
run: | | |
sudo npm install -g n | |
sudo n 16.13.1 | |
sudo npm install -g nodemon | |
cd backend | |
npm install | |
cd ../frontend | |
npm install | |
- name: build vue and deploy | |
run: | | |
cd ./frontend | |
npm run build | |
sudo rm -rf /var/www/html/* | |
sudo cp -r ./dist/* /var/www/html/ | |
- name: setup ngrok | |
run: | | |
wget "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.tgz" | |
tar zxvf ngrok-stable-linux-amd64.tgz | |
sudo chmod +x ./ngrok | |
- name: setup mongodb | |
run: | | |
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org | |
- name: run all | |
run: | | |
mkdir db | |
mongod --dbpath=./db & | |
./ngrok authtoken ${{ secrets.NGORKAUTHTOKEN }} | |
./ngrok http 80 & | |
shell: bash | |
- name: Get URL | |
id: vars | |
run: curl -s localhost:4040/api/tunnels | jq -r .tunnels[0].public_url | |
shell: bash | |
- name: gen README.md | |
run: | | |
echo "Last Update Time: " > README.md | |
date >> README.md | |
echo `curl -s localhost:4040/api/tunnels | jq -r .tunnels[0].public_url` >> README.md | |
- name: push | |
run: | | |
git add README.md | |
git config --global user.email "[email protected]" | |
git config --global user.name "actions bot" | |
git commit -m "test" | |
git push -f | |
- name: oao | |
run: | | |
cd backend | |
nodemon index.js |