Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpisa committed Jun 15, 2023
1 parent 6f3ab4a commit 5438f70
Showing 1 changed file with 26 additions and 33 deletions.
59 changes: 26 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,74 +11,67 @@
[![Rockero](https://img.shields.io/badge/Rockero-yellow)](https://rockero.cz)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)

Our deployer is designed to easily manage your staging/dev client sites on your `Forge` server. It is able to deploy your dev/staging branches and also pullrequests.
Our deployer simplifies management of your staging and development client sites on your `Forge` server by allowing easy deployment of dev/staging branches and pull requests.

When `Forge` has no site existing for your repository, deployer can automatically handle initial setup with repository, database and environment. It is also able to deploy your pull requests.
If your repository's site does not exist in Forge, our deployer will automatically create the site and handle the initial setup with repository, database, and environment.

**Example of deployed URLs:**
**URL examples of deployed applications:**

For `main` branch:

```
https://your-application.dev.your-domain.com
```bash
https://{your-application}.dev.{your-domain}.com
```

For `staging` branch:

```
https://your-application.staging.your-domain.com
```bash
https://{your-application}.staging.{your-domain}.com
```

For pull requests:

```
https://your-application-pull-request-number.dev.your-domain.com
```bash
https://{your-application}-{pull-request-number}.dev.{your-domain}.com
```

## Setup

At first, create a new repository in your GitHub account and use this repository as the template.
1. Begin by creating a new repository in your GitHub account and use this repostitory as the template.

Then create a new `Forge` site for the deployer and make initial deployment.
2. Next, create a new `Forge` site for the deployer and perform the initial deployment.

Fill up `.env` file values below:
3. To configure your project, please fill in the required values for your `.env` file below:

```
# Your custom deployer token for requests verification.
# Your custom deployer token for requests verification, you will use it in GitHub workflows.
DEPLOYER_TOKEN=
# Credentials of your `Forge` and also ID of the server, where you would like to have your dev/staging sites
# Credentials of your `Forge` and also ID of the server, where you would like to have your dev/staging sites.
FORGE_API_KEY=
FORGE_SERVER_ID=
FORGE_DOMAIN=
# GitHub tokens are used to automatically add comment with application URL to your pull requests
# GitHub tokens are used to automatically add comments with application URLs to your pull requests.
GITHUB_OWNER=
GITHUB_TOKEN=
```

Add this to your GitHub workflows:
4. Add the following job to your GitHub workflows using the code below:

```
name: CI
on:
push:
branches: [main, staging]
pull_request:
branches: [main, staging]
jobs:
deploy:
```yaml
deploy:
runs-on: ubuntu-latest

steps:
- name: Deployment
- name: Deployment
uses: fjogeleit/http-request-action@master
with:
url: "https://deployer-url.com/deploy/${{ github.event.repository.name }}/pull/${{ github.event.pull_request.number }}"
method: "POST"
bearerToken: "ABC"
timeout: 600000
data: '{"branch": ${{ github.ref }}, "number": ${{ github.event.pull_request.number }}}'
url: "http://your-deployer.com/deploy/${{ github.event.repository.name }}/event/${{ github.event_name }}"
method: "POST"
bearerToken: ${{ secrets.YOUR_DEPLOYER_TOKEN }}
timeout: 600000
data: '{"branch": "${{ github.ref_name }}", "number": "${{ github.event.pull_request.number }}"}'
```
The deployer is now ready to deploy your commits upon request. Happy deploying!

0 comments on commit 5438f70

Please sign in to comment.