You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running this project locally, make sure to have a `Firefox` client
55
-
installed on your machine. In order to deploy this web service on Google Cloud
56
-
from the terminal, you will also need to install the `gcloud CLI`. When using a
57
-
depolyed version of this project, you don't need to worry about the `Firefox`
58
-
client, as it will be installed as part of the `Docker` image.
57
+
- In order to run this service locally, you need to have a [Firefox](https://www.mozilla.org/) client installed on your machine.
58
+
- In order to deploy this image on Google Cloud, you will need a [Google Cloud Account](https://cloud.google.com/) and a project.
59
+
- You then also must [enable the Cloud Build API](https://console.cloud.google.com/apis/library/cloudbuild.googleapis.com)
60
+
as well and [enable the Cloud Run API](https://console.cloud.google.com/apis/library/run.googleapis.com).
61
+
- To deploy this service from the command line you need to install [gcloud CLI](https://cloud.google.com/sdk/docs/install).
62
+
- To deploy this service using `GitHub Actions` you need to export `Service
63
+
Account` credentials. See [Using GitHub Actions](#using-github-actions) for more information.
59
64
65
+
When using a depolyed version of this project, you don't need to worry about the
66
+
`Firefox` client, as it will be installed as part of the `Docker` image.
60
67
Further, following tools and technologies will be highlighted or are heavily in
61
-
use as part of this example - `RSelenium`, `plumber`, `Docker`,
68
+
use as part of this concept - `RSelenium`, `plumber`, `Docker`,
62
69
`Google Cloud Build`, `Google Cloud Run` and `GitHub Actions`.
63
70
64
71
## Usage
@@ -119,22 +126,15 @@ As a response the scraping service will return the requested dataset as `JSON`.
119
126
120
127
## Deployment
121
128
129
+
> ℹ️️️️️ _Documentation on IAM permissions need to be added. Further documentation
130
+
on Service Account usage and permissions is currently missing._
131
+
122
132
The following steps will walk you through the steps to create a `build` of this
123
133
project using [`Google Cloud Build`](https://cloud.google.com/build/docs/overview#:~:text=Cloud%20Build%20is%20a%20service,Docker%20containers%20or%20Java%20archives.) and then deploy it on [`Google Cloud Run`](https://cloud.google.com/run/docs/overview/what-is-cloud-run).
124
134
125
-
In order to deploy this web service on Google Cloud, please make sure you have a
126
-
[Google Cloud Account](https://cloud.google.com/). Create a project within your
127
-
account and enable the [`Cloud Build API`](https://console.cloud.google.com/apis/library/cloudbuild.googleapis.com)
128
-
as well as the [`Cloud Run API`](https://console.cloud.google.com/apis/library/run.googleapis.com).
129
-
To deploy this service from the command line, you will further
130
-
need to install the [`gcloud CLI`](https://cloud.google.com/sdk/docs/install).
131
-
132
135
In case you want to modify deployment parameters, feel free to adjust the
133
136
`cloudbuild.yaml` according to your needs.
134
137
135
-
> _⚠️ Documentation on IAM permissions need to be added. Further documentation
136
-
on Service Account usage and permissions is currently missing._
137
-
138
138
### Using the terminal
139
139
140
140
Once `gcloud CLI` is installed, execute the following command in the terminal
@@ -171,6 +171,34 @@ Docker images. Once the build is done, you will see your deployment on the
171
171
172
172
### Using GitHub Actions
173
173
174
+
The `GitHub Actions` workflow in this project is setup in a way, that with every
175
+
`push` to the `main` branch the `deploy-cloudrun` workflow will be triggered.
176
+
That workflow will automatically build the image in `Cloud Build` and deploy it
177
+
on `Cloud Run`.
178
+
179
+
```{yaml, eval=FALSE}
180
+
name: deploy-cloudrun
181
+
on:
182
+
push:
183
+
branches:
184
+
- 'main'
185
+
...
186
+
```
187
+
188
+
The `deploy-cloudrun` workflow uses the `google-github-actions/auth@v0` with a
189
+
`Service Account JSON key` to authenticate with Google Cloud. The `JSON` key
190
+
is stored as a Github secret and is named `GC_SA_ADMNIN_KEY`.
0 commit comments