-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic-workflow.yml
More file actions
61 lines (48 loc) · 1.44 KB
/
basic-workflow.yml
File metadata and controls
61 lines (48 loc) · 1.44 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Basic Workflow
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install Dependencies
run: |
npm ci --prefer-offline --no-audit
- name: Run Linters
run: npm run lint
- name: Run Tests
run: npm test
- name: Build
run: npm run build
- name: Verify
run:
- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: |
dist/
node_modules/ # You might want to remove this depending on your use case
deploy:
name: Deploy to Production
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push' # Only deploy on main branch push
steps:
- name: Download Build Artifacts
uses: actions/download-artifact@v2
with:
name: build-artifacts
path: dist
- name: Deploy to Server
# Add your deployment script here, e.g., SSH or using another deployment tool
run: |
# Deployment script:
scp -r dist/* user@your-server:/path/to/deploy
echo ${{ secrets.API_SECRET }}
ssh user@your-server "cd /path/to/deploy && ./deploy.sh"