-
Notifications
You must be signed in to change notification settings - Fork 56
71 lines (60 loc) · 1.67 KB
/
manual-deploy.yml
File metadata and controls
71 lines (60 loc) · 1.67 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
62
63
64
65
66
67
68
69
70
71
name: Manual Deploy
on:
workflow_dispatch:
inputs:
environment:
description: 'Deployment environment'
required: true
default: 'staging'
type: choice
options:
- staging
- production
skip_tests:
description: 'Skip test suite'
required: false
default: false
type: boolean
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.5'
bundler-cache: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
if: ${{ !inputs.skip_tests }}
run: npm test
- name: Build for staging
if: ${{ inputs.environment == 'staging' }}
run: npm run build:dev
env:
JEKYLL_ENV: development
- name: Build for production
if: ${{ inputs.environment == 'production' }}
run: npm run build
env:
JEKYLL_ENV: production
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: site-${{ inputs.environment }}-${{ github.sha }}
path: _site/
retention-days: 7
- name: Deploy notification
run: |
echo "🚀 Deployment completed for ${{ inputs.environment }}"
echo "📦 Build artifacts uploaded"
echo "🔗 Commit: ${{ github.sha }}"