-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (46 loc) · 1.29 KB
/
deploy.yml
File metadata and controls
56 lines (46 loc) · 1.29 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
name: Deploy QIT Docs
on:
workflow_dispatch: # Allows manual triggering of the workflow.
inputs:
deploy_target:
description: 'Deployment target'
required: true
default: 'staging'
type: choice
options:
- staging
- production
push:
branches:
- trunk
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
tools: none
php-version: '8.2'
- name: Npm Install
run: npm install
- name: Build
run: npm run build
- name: Zip Build Contents
working-directory: ./build
run: |
zip -r ${{ github.workspace }}/docs.zip .
- name: List files in the workspace.
run: ls -l ${{ github.workspace }}
- name: Deploy QIT Docs
run: |
php .github/workflows/scripts/deploy.php
env:
DOCS_SECRET: ${{ secrets.DOCS_SECRET }}
FILE: ${{ github.workspace }}/docs.zip
DEPLOY_TARGET: ${{ github.event.inputs.deploy_target || (github.ref == 'refs/heads/trunk' && 'production' || 'staging') }}