Skip to content

Commit c3d41b6

Browse files
committed
Finish the section on deploying the website.
1 parent 0461ca7 commit c3d41b6

File tree

1 file changed

+41
-4
lines changed

1 file changed

+41
-4
lines changed

analysis/workflowr.Rmd

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,55 @@ Re-running `wflow_status()` shows that all the files are "published":
173173
wflow_status()
174174
```
175175

176-
Create [new repository on GitHub](https://github.com/new)
176+
Now that the files are committed in the Git repository, it's time to push them
177+
to GitHub to share the analysis results.
177178

178-
Configure Git remote
179+
Go to [https://github.com/new](https://github.com/new) (you'll be prompted to
180+
login first if needed) to create a new repository. In the box labeled
181+
"Repository name", type "workflowr-spotify". Leave all the other settings as is,
182+
and click on the button "Create repository".
183+
184+
Back in the R console, you need to inform Git of the GitHub repository you just
185+
created. In Git terminology, a Git repository on a cloud service like GitHub is
186+
called a "remote". Workflowr provides a convenience function `wflow_git_remote()`
187+
to register remote repositores with Git. Run the command below using your GitHub
188+
username:
179189

180190
```{r git-remote}
181191
wflow_git_remote("origin", user = "<github-username>", repo = "workflowr-spotify")
182192
```
183193

184-
Push to GitHub. Enter username and password.
194+
Run `wflow_git_remote()` a second time, this time with no arguments, to have it
195+
list the available remote repositories. The URL will look something like
196+
`https://github.com/<github-username>/workflowr-spotify.git`.
197+
198+
```{r git-remote-confirm}
199+
wflow_git_remote()
200+
```
201+
202+
Note that "origin" is an alias for referring to that long URL. The name "origin"
203+
is a convention, and could be anything you wanted. The main benefit of following
204+
the convention is that it will make it easier to follow online
205+
troubleshooting resources.
206+
207+
Now that Git knows about the remote GitHub repository, push the project to
208+
GitHub using `wflow_git_push()`. You'll be prompted to enter your GitHub
209+
username in the R console followed by a secure popup menu for entering your
210+
GitHub password.
185211

186212
```{r git-push}
187213
wflow_git_push()
188214
```
189215

190-
Go to "Settings" and activate GitHub Pages.
216+
The updated GitHub repository will automatically open in a new tab. To activate
217+
the website, navigate to the Settings tab and scroll down to the section "GitHub
218+
Pages". Set the "Source" to "master branch /docs folder". After it automatically
219+
updates, scroll back down to the same section to retreive the URL. It will look
220+
like `https://<github-username>.github.io/workflowr-spotify/`. Click on it to
221+
view your workflowr website. If it displays a "404 Not Found" error, manually
222+
add `index.html` to the URL in the web browser (Long-term you don't have to do
223+
this. It only applies when GitHub Pages is first launching your website).
224+
225+
Now you have a website that containing your reprodubible results that you can
226+
share with your colleagues! And each time you make changes and push them to
227+
GitHub, the website will automatically update.

0 commit comments

Comments
 (0)