Skip to content

Commit

Permalink
Merge pull request pharmaverse#324 from Appsilon/test-staging
Browse files Browse the repository at this point in the history
Update documentation and add staging deployment
  • Loading branch information
sankhadeepdutta authored Oct 29, 2024
2 parents 47246b0 + 4fec519 commit 32e7d00
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 108 deletions.
79 changes: 45 additions & 34 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,81 @@
# Contributing to Pharmaverse Website

First off, thank you for considering contributing to the Pharmaverse Website! We appreciate your time and effort in improving this project. The following is a set of guidelines for contributing to the repository.
Thank you for considering contributing to the Pharmaverse Website! We truly appreciate your efforts in improving this project. Below are guidelines to help you understand how you can contribute and collaborate with us effectively.

## Table of Contents

1. [Governance](#governance)
1. [Branching and deployment strategy](#branching-and-deployment-strategy)
1. [Code of Conduct](#code-of-conduct)
1. [How can I contribute](#how-can-i-contribute)
2. [Branching and Deployment Strategy](#branching-and-deployment-strategy)
3. [Code of Conduct](#code-of-conduct)
4. [How Can I Contribute](#how-can-i-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Submitting Pull Requests](#submitting-pull-requests)
5. [Getting Help](#getting-help)

---

## Governance

[Access](https://github.com/pharmaverse/pharmaverse/settings/access) to the repo is limited to the council (who are GH organisation admins), and
members of the Github Team [website-maintainers](https://github.com/orgs/pharmaverse/teams/website-maintainers). Any other contributions must be made
as a pull request from a fork.
Access to the repository is restricted to members of the council (GitHub organization admins) and the [website-maintainers team](https://github.com/orgs/pharmaverse/teams/website-maintainers). Any external contributions must be made through pull requests from a forked repository. For further information on access, see the [repo access settings](https://github.com/pharmaverse/pharmaverse/settings/access).

---

## Branching and Deployment Strategy

## Branching and deployment strategy
1. **Default Branch**: The default branch is `develop`. All pull requests (PRs) must go through the `develop` branch before being merged into `main`.
2. **Deployment Pipeline**: The GitHub Actions [pipeline](https://github.com/pharmaverse/pharmaverse/blob/develop/.github/workflows/pipeline.yml) deploys code from the `main` and `develop` branches (to production and a testing space).
3. **Branch Lifecycle**: Once a branch has been deployed to `develop`, it should be deleted.
4. **Issue Tracking**: The [issue templates](https://github.com/pharmaverse/pharmaverse/tree/develop/.github/ISSUE_TEMPLATE) is utilised for reporting bugs and requesting features.

1. The default branch is `develop`, and all PRs should go through `develop` before being merged to `main`.
1. Our GH Action [pipeline](https://github.com/pharmaverse/pharmaverse/blob/develop/.github/workflows/pipeline.yml) deploys from `main` and `develop` (to prod and a testing space)
1. Branches should be deleted once they are deployed to `develop`
1. We use [issue templates](https://github.com/pharmaverse/pharmaverse/tree/develop/.github/ISSUE_TEMPLATE)
---

## Code of Conduct

This project adheres to the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
By participating, you are expected to uphold this code. Please report any unacceptable behavior to [a member of the pharmaverse council](https://pharmaverse.org/contribute/council/).
This project adheres to the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). By participating in this project, you are expected to uphold this code. If you encounter any violations, please report them to [a member of the Pharmaverse council](https://pharmaverse.org/contribute/council/).

---

## How Can I Contribute?

### Reporting Bugs

If you encounter any bugs, please report them by creating a new issue in the [GitHub Issues](https://github.com/pharmaverse/pharmaverse/issues) section. Include as much detail as possible:
If you encounter a bug, please report it by opening a new issue in the [GitHub Issues](https://github.com/pharmaverse/pharmaverse/issues) section. Be sure to include the following:

- Steps to reproduce the bug
- Expected and actual behavior
- Screenshots, if applicable
- Your environment (OS, browser, etc.)
- Steps to reproduce the bug.
- Expected and actual behavior.
- Screenshots (if applicable).
- Your environment (operating system, browser, etc.).

### Suggesting Enhancements

We welcome suggestions for new features or improvements! Please check the existing issues first to see if your idea has already been suggested. If not, feel free to create a new issue with the following details:
We welcome new feature suggestions! Before creating a new suggestion, please check if your idea has already been proposed. If not, feel free to open a new issue with the following:

- A clear and concise description of the enhancement
- The problem or use case it addresses
- Any related or similar features in other projects
- A clear and concise description of the enhancement.
- The problem or use case it addresses.
- Any related features or similar implementations in other projects.

### Submitting Pull Requests

If you're ready to contribute code, follow these steps:
If you're ready to contribute code, please follow these steps:

1. Fork the repository to your GitHub account.
2. Clone your fork to your local machine.
2. Clone the fork to your local machine.
3. Create a new branch from `develop` for your feature or bugfix.
4. Make your changes following the [style guides](#style-guides).
4. Follow our [style guidelines](#style-guides) while making your changes.
5. Test your changes locally.
6. Commit your changes with a descriptive commit message.
7. Push your branch to GitHub.
8. Create a Pull Request (PR) from your branch to the `develop` branch of the original repository.
6. Commit your changes with a clear and descriptive message.
7. Push the changes to your fork.
8. Submit a pull request (PR) from your branch to the `develop` branch of the main repository.

Your pull request will be reviewed by members of the tech-wg team, and you may be asked to make revisions based on the feedback.

Your PR will be reviewed by members of the tech-wg team. Please be prepared to make revisions based on feedback.
---

## Getting Help

If you need help, you can reach out to the tech-wg team through the following channels:
If you need any assistance or have questions, feel free to reach out through the following channels:

- GitHub Discussions in the repository
- [Slack Channel](https://pharmaverse.slack.com/)
- [pharmaverse.org](https://pharmaverse.org)
- GitHub Discussions in this repository.
- [Slack Channel](https://pharmaverse.slack.com/).
- [Pharmaverse Website](https://pharmaverse.org).
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!--- Please confirm you have checked this builds correctly on develop branch -->

- [ ] This is a PR into production (main), and I am doing it from develop
- [ ] If from develop, I have checked the code is working on the UAT site http://openpharma.s3-website.us-east-2.amazonaws.com/develop/
- [ ] If from develop, I have checked the code is working on the UAT site https://pharmaverse-staging-test.netlify.app/

# Description
<!--- What's new in this pull request? -->
Expand Down
50 changes: 22 additions & 28 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: github pages
on:
push:
branches:
- main # Set a branch to deploy
- develop # Note has logic around deployment
- main
- develop
schedule:
- cron: 0 13 * * 1 # At 13:00 on Monday

Expand All @@ -14,30 +14,27 @@ jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4.2.0
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

submodules: true
fetch-depth: 0
- name: Install curl
run: sudo apt update && sudo apt-get install -y libcurl4-openssl-dev

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.2.0'
r-version: "4.2.0"

- name: Setup renv
uses: r-lib/actions/setup-renv@v2
with:
cache-version: 2

# Run R code
# Rscript scripts/add_contributions.R disabled
- name: Run scripts
run: |
Rscript scripts/add_badges.R
# Rscript scripts/add_contributions.R disabled
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -49,12 +46,12 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.85.0'
hugo-version: "0.119.0"
extended: true

# IF main
# main branch
- name: Build
if: ${{ github.ref == 'refs/heads/main' }}
run: hugo --minify
Expand All @@ -66,19 +63,16 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public

# IF develop
#- name: Build
# if: ${{ github.ref == 'refs/heads/develop' }}
# run: hugo -e staging

#- name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v1
# if: ${{ github.ref == 'refs/heads/develop' }}
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: us-east-2
# develop branch
- name: Build
if: ${{ github.ref == 'refs/heads/develop' }}
run: hugo -e staging

#- name: Deploy static site to S3 bucket
# if: ${{ github.ref == 'refs/heads/develop' }}
# run: aws s3 sync ./public/ s3://openpharma/develop --delete
- name: Deploy to Netlify
uses: netlify/actions/cli@master
if: ${{ github.ref == 'refs/heads/develop' }}
with:
args: deploy --dir=public --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
116 changes: 72 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,62 @@
# pharmaverse website
# Pharmaverse Website

[pharmaverse.org](https://pharmaverse.org/)
## Overview

This website is maintained and governed by our website community.
Further details of this are available [here](https://pharmaverse.org/contribute/wg/).
The community lead is considered the product owner for the website and has final say on any decisions related to the website.
The [pharmaverse.org](https://pharmaverse.org/) website is maintained and governed by our website community. For more details on community involvement, please visit our [contribution page](https://pharmaverse.org/contribute/wg/). The community lead serves as the product owner for the website and has the final say on any website-related decisions.

For any questions or enhancements for the site, please make issues at this repo.
For questions or enhancement suggestions, please create issues in this repository.

## Hosted sites:
## Hosted Sites

This website is available at 2 locations:
The website is available at two locations:

- production: [pharmaverse.org](https://pharmaverse.org)
- `develop` branch: [openpharma.s3-website.us-east-2.amazonaws.com/develop/](http://openpharma.s3-website.us-east-2.amazonaws.com/develop/)
- Production: [pharmaverse.org](https://pharmaverse.org)
- `develop` branch: [pharmaverse-staging-test.netlify.app](https://pharmaverse-staging-test.netlify.app/)

## Development / git flow
## Development / Git Flow

When you push to `develop` OR make a pull request onto `develop` a github action will run which will render the site, and deploy
it to the test server. But the test server is different depending on which route you took.
### Workflow
This section outlines the development workflow that is followed to streamline the process of ensuring efficient collaboration, continuous integration, and smooth deployment.

The code on `develop` is hosted to: http://openpharma.s3-website.us-east-2.amazonaws.com/develop/
- Push to `develop` or create a pull request onto `develop`.
- The GitHub Action is then triggered, rendering and deploying the site to the deployment server. For `main` branch, the deployment server is [GitHub Pages](https://pages.github.com/) and for `develop` branch, it is [Netlify](https://www.netlify.com/).
- The `develop` branch is considered the UAT branch for pre-production checks.

The intended workflows expects that `develop` is the UAT branch where you check things pre-prod.
While the 'build from PR` allows you to work on something very experimental and check results, before pushing it do develop.
**Important notes:**

This git flow is predicated on it being unlikely to have more than one person actively working on the site at any one time.
- The git workflow is designed with the assumption that typically only one person will be actively working on the site at any given time.
- Direct work on the `main` branch is not allowed.
- All changes must come through `develop` via a pull request.

**You cannot work directly on `main` branch**. The only way to push in is via a PR. And it will be denied if
you have not come through `develop`. Any PR requires approval from one other Technology and Templates WG member.
### Pull Request Requirements

## Data flows
- PRs require approval from one other Technology and Templates WG member.
- PRs will be denied if they haven't come through the `develop` branch.

### 'Scraped' data
## Data Flows

Passive data is collected via openpharma.github.io, a sister org that is completely un-opinionated and has
a wider remit spanning discovery to access.
This site contains no curated data beyond names - and is instead focused on
collecting and sharing data on open source health and related metadata (e.g. CRAN status and riskmetric scores).
Information on the data collected is here: https://openpharma.github.io/#data.
### Scraped Data

Data is stored in a pharmaverse AWS account.
The passive data is collected via [OpenPharma](https://openpharma.github.io/), which is a sister organization that:

### Package info
- Has a completely un-opinionated approach and a wider remit spanning discovery to access.
- Contains no curated data beyond package names.
- Focuses on collecting and sharing:
- Open source health data
- Related metadata (e.g., CRAN status, riskmetric scores)

Curated package info is stored in the folder `data/`. `pharmaverse` packages are in the folder `data/packages`. Non-pharma packages that get a special
mention are in `data/nonpharma`. Each package is a unique `.yaml` file.
For detailed information on the collected data, visit: https://openpharma.github.io/#data

The general structure is:
### Package Info

Curated package info is stored in the `data/` folder.

- `data/packages/` contains `pharmaverse` packages details
- `data/nonpharma/` contains non-pharma packages details

Each of the packages has a unique `.yaml` file

Example structure:

```yaml
name: admiral
Expand All @@ -57,43 +66,62 @@ docs: https://pharmaverse.github.io/admiral/cran-release/
hex: https://github.com/insightsengineering/hex-stickers/raw/main/PNG/admiral.png
task: ADaM
details: (ADaM In R Asset Library) - Modular framework to generate ADaM via R functions relying on community contributions
splash: include # this controls what is shown on the main page. Plan is to deprecate and put all hex's up
splash: include # this controls what is shown on the main page. The plan is to deprecate and put all the hexes up.
```
It should be self explanatory. Please use the categories in the site for `task:`.
### Deployment
The `main` branch is deployed to [GitHub Pages](https://pages.github.com/), while the `develop` branch is deployed to [Netlify](https://www.netlify.com/). [Hugo](https://gohugo.io/) creates the static site in the `public` directory in the root of the project. This includes the HTML files, and assets such as images, CSS files, and JavaScript files.

- For the `main` branch, the [secret token](https://github.com/peaceiris/actions-gh-pages/tree/v3/#supported-tokens) is securely stored in the GitHub environemnt.
- For the `develop` branch, the Netlify authorization token and site id are also securely stored in the GitHub environemnt.

### People

Info on people is in `data/people`. The `yaml` should be something like below, with the filename being the github handle.
- Info on people is in `data/people/`
- Filename should be the GitHub handle

```yaml
Example structure:

```yaml
name: James Black
pharmaverse_roles: tech
company: Roche
company_logo: roche.png
# Following is more a nice to have for profile pages [and optional]
# Following is more of a nice to have for profile pages [and optional]
linkedin: https://www.linkedin.com/in/epijim/
site: https://epijim.uk
title: People and Product Family Leader for Insights Engineering, Scientific Computing Environment Product Owner
bio: James is currently leading our pan-study codebase for insights
```

### General content of the site
## Site Content

Site content is in `content`. It's normal markdown files. See [markdown-guide.md](markdown-guide.md).
The site content is in the `content/` directory. It contains standard markdown files. See [markdown-guide.md](markdown-guide.md) for more information.

### Calling package info in the site
### Calling Package Info in the Site

To call a package, we have two shortcuts. `pharmaverse` means it's 'pharmaverse' - e.g. in the folder
`data/packages`. `otherpackages` is for non-pharmaverse packages, in `data/nonpharma`.
To reference packages in the site content, use the following shortcodes:

- For pharmaverse packages (located in `data/packages/`):

```r
{{< pharmaverse pkg="rtables" >}}
```

- For non-pharmaverse packages (located in `data/nonpharma/`):

```r
{{< otherpackages pkg="gt" >}}
```

### Council meeting minutes
These shortcodes will automatically pull and display the relevant package information from the corresponding YAML files.

## Council Minutes of Meeting

- From 2023 onwards, monthly council meeting minutes are published in `static/council meeting minutes/`
- Other static files (e.g., images) are stored in the `static/` directory

## Contributing

From 2023 onwards, our monthly council meeting minutes will be published in `static/council meeting minutes`.
Other static files such as images are stored in `static` also.
We welcome contributions from the community! To ensure a smooth process, please review our [CONTRIBUTING.md](.github/CONTRIBUTING.md) guide for detailed instructions on how to get involved.
2 changes: 1 addition & 1 deletion config/staging/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
######################## staging configuration ####################
baseURL = "http://openpharma.s3-website.us-east-2.amazonaws.com/develop"
baseURL = "https://pharmaverse-staging-test.netlify.app"

0 comments on commit 32e7d00

Please sign in to comment.