generated from ccuffs/template-english
-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (55 loc) · 2.29 KB
/
ci-uffs-cc.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
47
48
49
50
51
52
53
54
55
name: ci.uffs.cc
on: push
env:
BUILD_HOST: ci.uffs.cc
BUILD_WEB_DIRECTORY: /home/ccuffsci/ci.uffs.cc/live-broadcast-kit
BUILD_WEB_URL: https://ci.uffs.cc/live-broadcast-kit
jobs:
build-deploy-audit:
name: Build, deploy and audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Prepare deploy server
uses: appleboy/ssh-action@master
with:
host: ${{ env.BUILD_HOST }}
username: ${{ secrets.CI_USERNAME }}
password: ${{ secrets.CI_PASSWORD }}
script: |
mkdir -p ${{ env.BUILD_WEB_DIRECTORY }}/${{ steps.extract_branch.outputs.branch }}/${{ github.sha }}
mkdir -p ${{ env.BUILD_WEB_DIRECTORY }}/${{ steps.extract_branch.outputs.branch }}/${{ github.sha }}/_report
- name: Deploy site via SSH
uses: garygrossgarten/github-action-scp@release
with:
local: ${{ github.workspace }}/
remote: ${{ env.BUILD_WEB_DIRECTORY }}/${{ steps.extract_branch.outputs.branch }}/${{ github.sha }}/
host: ${{ env.BUILD_HOST }}
username: ${{ secrets.CI_USERNAME }}
password: ${{ secrets.CI_PASSWORD }}
- name: Audit site performance
uses: jakejarvis/lighthouse-action@master
with:
url: ${{ env.BUILD_WEB_URL }}/${{ steps.extract_branch.outputs.branch }}/${{ github.sha }}
- name: Upload audit results as an artifact
uses: actions/upload-artifact@master
with:
name: report
path: './report'
- name: Copy audit report to deploy server via SSH
uses: garygrossgarten/github-action-scp@release
with:
local: ${{ github.workspace }}/report
remote: ${{ env.BUILD_WEB_DIRECTORY }}/${{ steps.extract_branch.outputs.branch }}/${{ github.sha }}/_report/
host: ${{ env.BUILD_HOST }}
username: ${{ secrets.CI_USERNAME }}
password: ${{ secrets.CI_PASSWORD }}
- name: Summary
run: |
echo "Summary:"
echo " Live URL: ${{ env.BUILD_WEB_URL }}/${{ steps.extract_branch.outputs.branch }}/${{ github.sha }}"
echo " Audit report URL: ${{ env.BUILD_WEB_URL }}/${{ steps.extract_branch.outputs.branch }}/${{ github.sha }}/_report"