forked from Bioconductor/bioconductor.org
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (90 loc) · 3.47 KB
/
pr_deploy.yaml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Pr - Preview
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
dev-pr-create-s3:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
environment: dev
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: "2.6.5"
- name: Install dependencies
run: |
gem install bundler
bundle install
- name: build website
run: rake
- name: Create Bucket
run: |
if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then
echo "Bucket already exists"
else
aws s3 mb s3://pr-preview-bioconductor-pr${{github.event.number}}
aws s3api delete-public-access-block --bucket pr-preview-bioconductor-pr${{github.event.number}}
aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-pr${{github.event.number}}
aws s3api put-bucket-website --bucket pr-preview-bioconductor-pr${{github.event.number}} \
--website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}'
fi
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-east-1"
- name: Deploy S3 Website
uses: danburtenshaw/[email protected]
with:
bucket-prefix: "pr-preview-bioconductor"
folder-to-copy: "./output"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
kpi_metrics:
needs: dev-pr-create-s3
permissions:
pull-requests: write
name: All KPI metrics
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 18
- name: install psi and axe
run: |
npm install psi
npm install @axe-core/cli
- name: run desktop psi
run: |
echo "DESKTOP_PSI_RESULTS<<EOF" >> $GITHUB_ENV
echo "$(node PageSpeed.js http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com desktop 50)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: run mobile psi
run: |
echo "MOBILE_PSI_RESULTS<<EOF" >> $GITHUB_ENV
echo "$(node PageSpeed.js http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com mobile 50)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: add_comment_pageSpeed
uses: mshick/add-pr-comment@v2
with:
message: |
${{env.DESKTOP_PSI_RESULTS}}
${{env.MOBILE_PSI_RESULTS}}
message-id: psi
- name: run axe accesibility test
run: |
echo "AXE_RESULTS<<EOF" >> $GITHUB_ENV
echo "$(npx axe http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: add_comment_axe
uses: mshick/add-pr-comment@v2
with:
message: ${{env.AXE_RESULTS}}
message-id: axe