Skip to content

Commit a61bbe9

Browse files
committed
Merge branch 'redesign2023' of https://github.com/nearform/bioconductor.org into nearform-redesign2023
2 parents 229b8e9 + 05b39bb commit a61bbe9

File tree

230 files changed

+13116
-4293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+13116
-4293
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
assets/js/search.js
2+
assets/js/bioconductor.js
3+
assets/js/bioc_views.js

.eslintrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"es6": true,
6+
"node": true
7+
},
8+
"extends": "eslint:recommended",
9+
"parserOptions": {
10+
"ecmaVersion": "latest",
11+
"sourceType": "module"
12+
},
13+
"rules": {}
14+
}

.github/workflows/linter.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Run Linters
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize]
5+
6+
jobs:
7+
build:
8+
if: github.event.pull_request.draft == false
9+
name: Run Linters
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: read
14+
statuses: write
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
- name: Lint Code Base
21+
uses: super-linter/super-linter/slim@v5
22+
env:
23+
LINTER_RULES_PATH: /
24+
VALIDATE_ALL_CODEBASE: false
25+
VALIDATE_GITHUB_ACTIONS: false
26+
VALIDATE_MARKDOWN: false
27+
VALIDATE_NATURAL_LANGUAGE: false
28+
VALIDATE_JSCPD: false
29+
VALIDATE_JSON: false
30+
VALIDATE_R: false
31+
VALIDATE_RUBY: false
32+
VALIDATE_JAVASCRIPT_STANDARD: false
33+
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json
34+
DEFAULT_BRANCH: redesign2023
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_close.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: PR - Closed
2+
on:
3+
pull_request:
4+
types: [closed]
5+
6+
jobs:
7+
dev-pr-close-s3:
8+
runs-on: ubuntu-latest
9+
environment: dev
10+
steps:
11+
- name: Empty Website Bucket
12+
run: |
13+
if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then
14+
aws s3 rm s3://pr-preview-bioconductor-pr${{github.event.number}} --recursive
15+
echo "BUCKET_EXISTS=true" >> "$GITHUB_ENV"
16+
else
17+
echo "Bucket does not exist"
18+
echo "BUCKET_EXISTS=false" >> "$GITHUB_ENV"
19+
fi
20+
env:
21+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
22+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
23+
AWS_REGION: "us-east-1"
24+
- name: Delete Website Bucket
25+
if: ${{env.BUCKET_EXISTS == 'true'}}
26+
uses: danburtenshaw/[email protected]
27+
with:
28+
bucket-prefix: "pr-preview-bioconductor"
29+
env:
30+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
31+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_deploy.yaml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Pr - Preview
2+
on:
3+
pull_request:
4+
types: [opened, reopened, synchronize]
5+
jobs:
6+
dev-pr-create-s3:
7+
if: github.event.pull_request.draft == false
8+
9+
runs-on: ubuntu-latest
10+
environment: dev
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Restore Nanoc Cache
16+
id: cache-nanoc-tmp
17+
uses: actions/cache/restore@v3
18+
with:
19+
path: tmp
20+
key: ${{ runner.os }}-nanoc-tmp
21+
22+
- name: Restore Site Output Cache
23+
id: cache-site-output
24+
uses: actions/cache/restore@v3
25+
with:
26+
path: output
27+
key: ${{ runner.os }}-site-output
28+
29+
- name: Set up ruby
30+
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
31+
with:
32+
ruby-version: "2.6.5"
33+
34+
- name: Install dependencies
35+
run: bundle install --jobs 4 --retry 3
36+
37+
- name: build website
38+
run: rake
39+
40+
- name: Create Bucket
41+
run: |
42+
if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then
43+
echo "Bucket already exists"
44+
else
45+
aws s3 mb s3://pr-preview-bioconductor-pr${{github.event.number}}
46+
aws s3api delete-public-access-block --bucket pr-preview-bioconductor-pr${{github.event.number}}
47+
aws s3api delete-bucket-ownership-controls --bucket pr-preview-bioconductor-pr${{github.event.number}}
48+
aws s3api put-bucket-website --bucket pr-preview-bioconductor-pr${{github.event.number}} \
49+
--website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}'
50+
fi
51+
env:
52+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
53+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
54+
AWS_REGION: "us-east-1"
55+
- name: Deploy S3 Website
56+
uses: danburtenshaw/[email protected]
57+
with:
58+
bucket-prefix: "pr-preview-bioconductor"
59+
folder-to-copy: "./output"
60+
env:
61+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
62+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
kpi_metrics:
65+
needs: dev-pr-create-s3
66+
permissions:
67+
pull-requests: write
68+
name: All KPI metrics
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: checkout
72+
uses: actions/checkout@v3
73+
- name: Setup Node.js environment
74+
uses: actions/[email protected]
75+
with:
76+
node-version: 18
77+
- name: install psi and axe
78+
run: |
79+
npm install psi
80+
npm install @axe-core/cli
81+
- name: run desktop psi
82+
run: |
83+
echo "DESKTOP_PSI_RESULTS<<EOF" >> $GITHUB_ENV
84+
echo "$(node PageSpeed.js url=http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com,strategy=desktop,threshold=50,apiKey=none)" >> $GITHUB_ENV
85+
echo "EOF" >> $GITHUB_ENV
86+
- name: run mobile psi
87+
run: |
88+
echo "MOBILE_PSI_RESULTS<<EOF" >> $GITHUB_ENV
89+
echo "$(node PageSpeed.js url=http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com,strategy=mobile,threshold=50,apiKey=none)" >> $GITHUB_ENV
90+
echo "EOF" >> $GITHUB_ENV
91+
- name: add_comment_pageSpeed
92+
uses: mshick/add-pr-comment@v2
93+
with:
94+
message: |
95+
${{env.DESKTOP_PSI_RESULTS}}
96+
${{env.MOBILE_PSI_RESULTS}}
97+
message-id: psi
98+
- name: run axe accesibility test
99+
run: |
100+
echo "AXE_RESULTS<<EOF" >> $GITHUB_ENV
101+
echo "$(npx axe http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com)" >> $GITHUB_ENV
102+
echo "EOF" >> $GITHUB_ENV
103+
- name: add_comment_axe
104+
uses: mshick/add-pr-comment@v2
105+
with:
106+
message: ${{env.AXE_RESULTS}}
107+
message-id: axe

.github/workflows/staging.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Deploy To staging
2+
3+
on:
4+
push:
5+
branches:
6+
- redesign2023
7+
jobs:
8+
staging-deploy:
9+
concurrency: ci-${{ github.ref }}
10+
runs-on: ubuntu-latest
11+
environment: staging
12+
13+
steps:
14+
- name: checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Use Nanoc Cache
18+
id: cache-nanoc-tmp
19+
uses: actions/cache@v3
20+
with:
21+
path: tmp
22+
key: ${{ runner.os }}-nanoc-tmp
23+
24+
- name: Use Site Output Cache
25+
id: cache-site-output
26+
uses: actions/cache@v3
27+
with:
28+
path: output
29+
key: ${{ runner.os }}-site-output
30+
31+
- name: Set up ruby
32+
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
33+
with:
34+
ruby-version: "2.6.5"
35+
36+
- name: Install dependencies
37+
run: bundle install --jobs 4 --retry 3
38+
39+
- name: Build website
40+
run: rake
41+
42+
- name: Deploy website to staging s3
43+
uses: Reggionick/[email protected]
44+
with:
45+
folder: output
46+
bucket: ${{secrets.S3_BUCKET}}
47+
bucket-region: us-east-1
48+
delete-removed: true
49+
env:
50+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
51+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
52+
kpi_metrics:
53+
needs: staging-deploy
54+
permissions:
55+
pull-requests: write
56+
name: All KPI metrics
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: checkout
60+
uses: actions/checkout@v3
61+
- name: Setup Node.js environment
62+
uses: actions/[email protected]
63+
with:
64+
node-version: 18
65+
- name: install psi and axe
66+
run: |
67+
npm install psi
68+
npm install @axe-core/cli
69+
- name: run desktop psi
70+
run: |
71+
echo "DESKTOP_PSI_RESULTS<<EOF" >> $GITHUB_ENV
72+
echo "$(node PageSpeed.js url=${{vars.STAGING_URL}},strategy=desktop,threshold=50,apiKey=none)" >> $GITHUB_ENV
73+
echo "EOF" >> $GITHUB_ENV
74+
- name: run mobile psi
75+
run: |
76+
echo "MOBILE_PSI_RESULTS<<EOF" >> $GITHUB_ENV
77+
echo "$(node PageSpeed.js url=${{vars.STAGING_URL}},strategy=mobile,threshold=50,apiKey=none)" >> $GITHUB_ENV
78+
echo "EOF" >> $GITHUB_ENV
79+
- name: run axe accesibility test
80+
run: |
81+
echo "AXE_RESULTS<<EOF" >> $GITHUB_ENV
82+
echo "$(npx axe ${{vars.STAGING_URL}})" >> $GITHUB_ENV
83+
echo "EOF" >> $GITHUB_ENV
84+
- name: send notification psi
85+
if: ${{ github.ref == 'refs/heads/redesign2023' }}
86+
uses: 8398a7/action-slack@v2
87+
with:
88+
status: ${{ job.status }}
89+
text: "${{env.DESKTOP_PSI_RESULTS}} \n ${{env.MOBILE_PSI_RESULTS}}"
90+
env:
91+
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK}}
92+
- name: send notification axe
93+
if: ${{ github.ref == 'refs/heads/redesign2023' }}
94+
uses: 8398a7/action-slack@v2
95+
with:
96+
status: ${{ job.status }}
97+
text: "${{env.AXE_RESULTS}}"
98+
env:
99+
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK}}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ assets/help/workflows/*
2323
workflows_tmp/
2424
content/help/workflows/*
2525
postgresql_password
26-
manifest/*
26+
manifest/*
27+
node_modules/
28+
package

.htmlhintrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"doctype-first": false,
3+
"spec-char-escape": false,
4+
"head-script-disabled": true,
5+
"style-disabled": true,
6+
"attr-lowercase": true,
7+
"attr-no-duplications": true,
8+
"attr-no-unnecessary-whitespace": true,
9+
"attr-value-single-quotes": false,
10+
"attr-value-double-quotes": true,
11+
"attr-whitespace": true,
12+
"alt-require": true,
13+
"input-requires-lable": true,
14+
"tag-pair": false,
15+
"tagname-lowercase": true,
16+
"tagname-specialchars": true,
17+
"src-not-empty": true,
18+
"id-class-value": "dash",
19+
"inline-script-disabled": true,
20+
"inline-style-disabled": true
21+
}

.stylelintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["stylelint-config-standard"]
3+
}

Dockerfile

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
FROM ruby:2.6.5
22

33
## System dependencies
4-
5-
RUN apt-get update && apt install -y \
6-
rsync \
7-
&& apt-get clean \
8-
&& rm -rf /var/lib/apt/lists/*
4+
RUN apt-get update && apt-get install -y \
5+
rsync \
6+
&& apt-get clean \
7+
&& rm -rf /var/lib/apt/lists/*
98

109
## Install gems
10+
COPY Gemfile /opt
11+
COPY Gemfile.lock /opt
12+
13+
## Set the working directory to /opt/bioconductor.org
14+
WORKDIR /opt/bioconductor.org
15+
16+
## Copy the remaining files from bioconductor.org/ to /opt/bioconductor.org
17+
COPY . .
1118

12-
COPY Gemfile /tmp
13-
COPY Gemfile.lock /tmp
14-
WORKDIR /tmp
15-
## RUN bundle lock
19+
## Install bundle and dependencies
20+
RUN gem install bundler
1621
RUN bundle install --jobs=4 && bundle clean --force
1722

1823
## Set up web server
19-
2024
EXPOSE 3000
2125

2226
## Create startup script
23-
24-
RUN echo '#! /bin/bash \n\
25-
cd /bioconductor.org \n\
26-
rake \n\
27-
cd output \n\
28-
adsf\n' > .startup.sh \\
27+
RUN echo '#! /bin/bash' > .startup.sh \
28+
&& echo 'cd /opt/bioconductor.org' >> .startup.sh \
29+
&& echo 'rake' >> .startup.sh \
30+
&& echo 'cd output' >> .startup.sh \
31+
&& echo 'adsf' >> .startup.sh \
2932
&& chmod +x .startup.sh
3033

31-
CMD ["./.startup.sh"]
34+
CMD ["/opt/bioconductor.org/.startup.sh"]

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
raise 'Ruby version must be 2.3 or greater' unless RUBY_VERSION.to_f >= 2.3
22
source 'http://rubygems.org'
3-
gem "nanoc", "~> 4.0"
3+
gem "nanoc", "~> 4.9.5"
44
gem "pry"
55
gem "pry-byebug"
66
gem "rdiscount"

0 commit comments

Comments
 (0)