Skip to content

Merge branch 'main' into prod #174

Merge branch 'main' into prod

Merge branch 'main' into prod #174

Workflow file for this run

name: Rollup
on:
push:
branches: [ "prod" ]
jobs:
build_and_deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run build --if-present
- name: copy file via ssh password
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
source: "./build/"
target: "/home/aukus/deploy/frontend/prod/deploy_build"
- name: swap build and restart nginx
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
command_timeout: 1m
script: cd "/home/aukus/deploy/frontend/prod" && sudo systemctl stop nginx && rm -rf build && mv deploy_build/build ./ && sudo systemctl start nginx
- name: Aukus frontend build and upload success!
uses: rjstone/discord-webhook-notify@v1
if: success()
with:
severity: info
details: Aukus frontend build and upload success!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: Aukus frontend build and upload failure!
uses: rjstone/discord-webhook-notify@v1
if: failure()
with:
severity: error
details: Aukus frontend build and upload failure!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}