Skip to content

Commit

Permalink
chore: update branch details in dev and CONTRIBUTING (#651)
Browse files Browse the repository at this point in the history
* chore: update branch details in dev and CONTRIBUTING

* Remove stage from README
  • Loading branch information
dcroote authored Oct 19, 2023
1 parent fafef62 commit 52891eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 49 deletions.
20 changes: 7 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ useful links:

### Git Workflow:

- `live-site` branch: for the current live site
- `main` branch: for the current live site
[docs.api3.org](https://docs.api3.org)
- `main` branch: for the staging site.

[Check this out](https://docs.api3.org/dev/firebase.html#repo-branches) for more
info about the branches.
Expand All @@ -96,14 +95,9 @@ You can:

### Making a PR

After making all the changes, submit a PR against the `main` branch. The PR will
be reviewed by the team and merged into the `main` branch. Make sure to link the
issue in the PR description.

You will then be able to see the changes with a Firebase preview link. Each PR
has its own Firebase preview site. The URL will be available in the PR's
comments.

The changes will be deployed to the staging site. Once the changes are reviewed
and approved, the changes will be merged from `main` into the `live-site` branch
and deployed to the live site.
After making changes in a feature branch, submit a PR against the `main` branch.
Make sure to link the corresponding GitHub Issue in the PR description e.g.
`Closes #1`. You will be able to see the changes within a Firebase preview
deployment that is unique to the PR. The PR will be reviewed by the team and
merged into the `main` branch, which will result in the changes going live into
production.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Firebase is used to host the `vitepress-docs` technical documentation.
- DNS: https://docs.api3.org
- Hosted with Firebase: https://vitepress-docs.web.app

### Stage

- Hosted with Firebase: https://vitepress-docs--stage-1sggkn03.web.app/

### Previews

Additionally each PR has its own Firebase preview site. The URL will be
Expand Down
37 changes: 5 additions & 32 deletions docs/dev/firebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,14 @@ tags:

# {{$frontmatter.title}}

All sites for production, staging, and PR previews are published on Firebase
hosting. All sites are build automatically using GitHub
All production and PR preview deployments are published on Firebase hosting and
are built automatically using GitHub
[workflows](https://github.com/api3dao/vitepress-docs/tree/main/.github/workflows)
stored in the `vitepress-docs` repo.

- Production: https://vitepress-docs.web.app
- Staging: https://vitepress-docs--stage-1sggkn03.web.app
- Production: https://vitepress-docs.web.app (and https://docs.api3.org)

## Repo Branches

The branch `live-site` is only used to generate the production web site for the
docs. When `main` is merged to `live-site` a production deployment is triggered.
The default branch remains as `main`. When a PR merges to `main`, this triggers
a Firebase staging deployment.

## PRs on `live-site`, merge only

When merging `main` into `live-site` do not "Squash and Merge". Use a regular
merge. Otherwise `live-site` will end up with its own commit history. If you
mistakenly do so, follow these instructions to fix this issue.

From branch main locally:

```bash
git branch -d live-site
git checkout -b live-site <abc>
git push origin live-site --force
```

1. Delete the `live-site` branch locally.
2. Checkout a new branch, `live-site`, from main commit `<abc>`,  which is the
commit before the last main commit.
3. Force push `live-site` to github. This now puts `live-site` 1 commit behind
main in the network graph, thereby enabling a clean PR from main into
`live-site`.

Going forward, PRs should just work easily so long as there aren't squash
commits on `live-site`.
When a PR is merged into the default branch, `main`, a Firebase deployment of
the docs production website is triggered.

0 comments on commit 52891eb

Please sign in to comment.