Cleaned up workflows
This commit is contained in:
@@ -1,59 +0,0 @@
|
|||||||
name: Build & Deploy OS League Tools
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ["cicd"]
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20'
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build production bundle
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: frontend-build
|
|
||||||
path: build/
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
runs-on: [frontend]
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- name: Download artifact
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: frontend-build
|
|
||||||
path: /home/sonder/deploy/os-league-tools-build
|
|
||||||
|
|
||||||
- name: List deploy directory
|
|
||||||
run: ls -al /home/sonder/deploy/os-league-tools-build
|
|
||||||
|
|
||||||
- name: Stop service
|
|
||||||
run: sudo systemctl stop os-league-tools || true
|
|
||||||
|
|
||||||
- name: Deploy new build
|
|
||||||
run: |
|
|
||||||
sudo rm -rf /home/sonder/leagues-tools/os-league-tools-master/build
|
|
||||||
sudo cp -r /home/sonder/deploy/os-league-tools-build /home/sonder/leagues-tools/os-league-tools-master/build
|
|
||||||
sudo chown -R sonder:sonder /home/sonder/leagues-tools/os-league-tools-master/build
|
|
||||||
|
|
||||||
- name: Start service
|
|
||||||
run: sudo systemctl start os-league-tools
|
|
||||||
|
|
||||||
- name: Cleanup deploy artifacts
|
|
||||||
run: rm -rf /home/sonder/deploy/os-league-tools-build
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
name: Build and Deploy to GH Pages
|
|
||||||
on: [workflow_dispatch]
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install and build
|
|
||||||
run: |
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
env:
|
|
||||||
REACT_APP_GA_MID: ${{ secrets.REACT_APP_GA_MID }}
|
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
if: success()
|
|
||||||
uses: crazy-max/ghaction-github-pages@v2
|
|
||||||
with:
|
|
||||||
target_branch: gh-pages
|
|
||||||
build_dir: build
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"predev": "npm run build:styles",
|
"predev": "npm run build:styles",
|
||||||
"predeploy": "npm run build",
|
"predeploy": "npm run build",
|
||||||
"deploy": "gh-pages -d build",
|
"deploy": "gh-pages -d build",
|
||||||
"prepare": "if exist .git (husky install) else (echo Skipping husky install)",
|
"prepare": "[ -d .git ] && husky install || true",
|
||||||
"refresh:tasks": "node scripts/formatTaskScraperJson.js"
|
"refresh:tasks": "node scripts/formatTaskScraperJson.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user