Continuous Delivery #396
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
# This is a basic workflow to help you get started with Actions | |
name: Continuous Delivery | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ master ] | |
# Trigger the workflow every day at midnight | |
schedule: | |
- cron: 0 0 * * * | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: self-hosted | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# Runs a set of commands using the runners shell | |
- name: Build and deploy the application | |
run: | | |
cd $GITHUB_WORKSPACE | |
npm install | |
npm audit fix || true | |
pm2 stop rsplatoon-bot | |
pm2 stop rpokemonunite-bot | |
pm2 stop trendless-splatoon-bot | |
cp -r $GITHUB_WORKSPACE/* /home/sha_tindle/repos/rsplatoon-crosspost | |
cp -r $GITHUB_WORKSPACE/* /home/sha_tindle/repos/rpokemonunite-crosspost | |
cp -r $GITHUB_WORKSPACE/* /home/sha_tindle/repos/trendless-splatoon-bot | |
pm2 start rsplatoon-bot | |
pm2 start rpokemonunite-bot | |
pm2 start trendless-splatoon-bot |