-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'redesign2023' of https://github.com/nearform/bioconduct…
…or.org into nearform-redesign2023
- Loading branch information
Showing
230 changed files
with
13,116 additions
and
4,293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
assets/js/search.js | ||
assets/js/bioconductor.js | ||
assets/js/bioc_views.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Run Linters | ||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
build: | ||
if: github.event.pull_request.draft == false | ||
name: Run Linters | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: read | ||
statuses: write | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Lint Code Base | ||
uses: super-linter/super-linter/slim@v5 | ||
env: | ||
LINTER_RULES_PATH: / | ||
VALIDATE_ALL_CODEBASE: false | ||
VALIDATE_GITHUB_ACTIONS: false | ||
VALIDATE_MARKDOWN: false | ||
VALIDATE_NATURAL_LANGUAGE: false | ||
VALIDATE_JSCPD: false | ||
VALIDATE_JSON: false | ||
VALIDATE_R: false | ||
VALIDATE_RUBY: false | ||
VALIDATE_JAVASCRIPT_STANDARD: false | ||
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json | ||
DEFAULT_BRANCH: redesign2023 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: PR - Closed | ||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
dev-pr-close-s3: | ||
runs-on: ubuntu-latest | ||
environment: dev | ||
steps: | ||
- name: Empty Website Bucket | ||
run: | | ||
if aws s3api head-bucket --bucket pr-preview-bioconductor-pr${{github.event.number}} 2>/dev/null; then | ||
aws s3 rm s3://pr-preview-bioconductor-pr${{github.event.number}} --recursive | ||
echo "BUCKET_EXISTS=true" >> "$GITHUB_ENV" | ||
else | ||
echo "Bucket does not exist" | ||
echo "BUCKET_EXISTS=false" >> "$GITHUB_ENV" | ||
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: Delete Website Bucket | ||
if: ${{env.BUCKET_EXISTS == 'true'}} | ||
uses: danburtenshaw/[email protected] | ||
with: | ||
bucket-prefix: "pr-preview-bioconductor" | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
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: Restore Nanoc Cache | ||
id: cache-nanoc-tmp | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: tmp | ||
key: ${{ runner.os }}-nanoc-tmp | ||
|
||
- name: Restore Site Output Cache | ||
id: cache-site-output | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: output | ||
key: ${{ runner.os }}-site-output | ||
|
||
- name: Set up ruby | ||
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 | ||
with: | ||
ruby-version: "2.6.5" | ||
|
||
- name: Install dependencies | ||
run: bundle install --jobs 4 --retry 3 | ||
|
||
- 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 url=http://pr-preview-bioconductor-pr${{github.event.number}}.s3-website-us-east-1.amazonaws.com,strategy=desktop,threshold=50,apiKey=none)" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: run mobile psi | ||
run: | | ||
echo "MOBILE_PSI_RESULTS<<EOF" >> $GITHUB_ENV | ||
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Deploy To staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- redesign2023 | ||
jobs: | ||
staging-deploy: | ||
concurrency: ci-${{ github.ref }} | ||
runs-on: ubuntu-latest | ||
environment: staging | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Nanoc Cache | ||
id: cache-nanoc-tmp | ||
uses: actions/cache@v3 | ||
with: | ||
path: tmp | ||
key: ${{ runner.os }}-nanoc-tmp | ||
|
||
- name: Use Site Output Cache | ||
id: cache-site-output | ||
uses: actions/cache@v3 | ||
with: | ||
path: output | ||
key: ${{ runner.os }}-site-output | ||
|
||
- name: Set up ruby | ||
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 | ||
with: | ||
ruby-version: "2.6.5" | ||
|
||
- name: Install dependencies | ||
run: bundle install --jobs 4 --retry 3 | ||
|
||
- name: Build website | ||
run: rake | ||
|
||
- name: Deploy website to staging s3 | ||
uses: Reggionick/[email protected] | ||
with: | ||
folder: output | ||
bucket: ${{secrets.S3_BUCKET}} | ||
bucket-region: us-east-1 | ||
delete-removed: true | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
kpi_metrics: | ||
needs: staging-deploy | ||
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 url=${{vars.STAGING_URL}},strategy=desktop,threshold=50,apiKey=none)" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: run mobile psi | ||
run: | | ||
echo "MOBILE_PSI_RESULTS<<EOF" >> $GITHUB_ENV | ||
echo "$(node PageSpeed.js url=${{vars.STAGING_URL}},strategy=mobile,threshold=50,apiKey=none)" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: run axe accesibility test | ||
run: | | ||
echo "AXE_RESULTS<<EOF" >> $GITHUB_ENV | ||
echo "$(npx axe ${{vars.STAGING_URL}})" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: send notification psi | ||
if: ${{ github.ref == 'refs/heads/redesign2023' }} | ||
uses: 8398a7/action-slack@v2 | ||
with: | ||
status: ${{ job.status }} | ||
text: "${{env.DESKTOP_PSI_RESULTS}} \n ${{env.MOBILE_PSI_RESULTS}}" | ||
env: | ||
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK}} | ||
- name: send notification axe | ||
if: ${{ github.ref == 'refs/heads/redesign2023' }} | ||
uses: 8398a7/action-slack@v2 | ||
with: | ||
status: ${{ job.status }} | ||
text: "${{env.AXE_RESULTS}}" | ||
env: | ||
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"doctype-first": false, | ||
"spec-char-escape": false, | ||
"head-script-disabled": true, | ||
"style-disabled": true, | ||
"attr-lowercase": true, | ||
"attr-no-duplications": true, | ||
"attr-no-unnecessary-whitespace": true, | ||
"attr-value-single-quotes": false, | ||
"attr-value-double-quotes": true, | ||
"attr-whitespace": true, | ||
"alt-require": true, | ||
"input-requires-lable": true, | ||
"tag-pair": false, | ||
"tagname-lowercase": true, | ||
"tagname-specialchars": true, | ||
"src-not-empty": true, | ||
"id-class-value": "dash", | ||
"inline-script-disabled": true, | ||
"inline-style-disabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": ["stylelint-config-standard"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
FROM ruby:2.6.5 | ||
|
||
## System dependencies | ||
|
||
RUN apt-get update && apt install -y \ | ||
rsync \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN apt-get update && apt-get install -y \ | ||
rsync \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
## Install gems | ||
COPY Gemfile /opt | ||
COPY Gemfile.lock /opt | ||
|
||
## Set the working directory to /opt/bioconductor.org | ||
WORKDIR /opt/bioconductor.org | ||
|
||
## Copy the remaining files from bioconductor.org/ to /opt/bioconductor.org | ||
COPY . . | ||
|
||
COPY Gemfile /tmp | ||
COPY Gemfile.lock /tmp | ||
WORKDIR /tmp | ||
## RUN bundle lock | ||
## Install bundle and dependencies | ||
RUN gem install bundler | ||
RUN bundle install --jobs=4 && bundle clean --force | ||
|
||
## Set up web server | ||
|
||
EXPOSE 3000 | ||
|
||
## Create startup script | ||
|
||
RUN echo '#! /bin/bash \n\ | ||
cd /bioconductor.org \n\ | ||
rake \n\ | ||
cd output \n\ | ||
adsf\n' > .startup.sh \\ | ||
RUN echo '#! /bin/bash' > .startup.sh \ | ||
&& echo 'cd /opt/bioconductor.org' >> .startup.sh \ | ||
&& echo 'rake' >> .startup.sh \ | ||
&& echo 'cd output' >> .startup.sh \ | ||
&& echo 'adsf' >> .startup.sh \ | ||
&& chmod +x .startup.sh | ||
|
||
CMD ["./.startup.sh"] | ||
CMD ["/opt/bioconductor.org/.startup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.