-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.27 KB
/
backend-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Deploy Backend
on:
push:
workflow_dispatch:
jobs:
test: # just make sure the node server can be run
defaults:
run:
working-directory: ./backend
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install
deploy:
needs: test
environment: github-pages
runs-on: ubuntu-latest
steps:
- name: Checkout repository to github-repo
uses: actions/checkout@v4
with:
path: github-repo
- name: Deploy to glitch.com # best way so far to deploy to glitch.com; see https://help.glitch.com/hc/en-us/articles/16287554099213-Pushing-Local-Code-to-a-Project
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git clone ${{ secrets.BACKEND_GIT_URL }} glitch-repo
cd glitch-repo
cp -rf ${{ github.workspace }}/github-repo/backend/* .
git add .
git commit -m "Automated deployed via GitHub Actions"
git push ${{ secrets.BACKEND_GIT_URL }}