Skip to content

Commit 0302827

Browse files
committed
Split up Deploy to GitHub, highlight Optionalness
1 parent fc3ebdc commit 0302827

9 files changed

+167
-151
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
div :class => "deploying" do
2-
h1 "Deploying"
2+
h1 "Optional Step: Deploying to GitHub"
33
blockquote do
4-
message "Before the next step, you could try deploying your page to GitHub! If you haven't used Git or GitHub before, you might prefer to do this later."
5-
link 'deploying_to_github_pages'
4+
message "Before the next step, you could try deploying (sending your code) your page to GitHub! If you haven't used Git or GitHub before, **it's okay to do this later**."
5+
link 'deploying_to_github'
66
end
77
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
div :class => "deploying" do
2+
h1 "Optional Step: Deploying to GitHub again"
3+
blockquote do
4+
5+
message <<-MARKDOWN
6+
Before the next step, you could try deploying your page to GitHub!
7+
8+
* If you have already deployed to GitHub, go on to [Deploying to GitHub again](deploying_to_github_again).
9+
* If this is your first time deploying, start at [Deploying to GitHub](deploying_to_github)
10+
MARKDOWN
11+
12+
end
13+
end
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
goals do
2+
goal "Create a new git repository locally"
3+
goal "Create a new git repository on GitHub"
4+
goal "Push your local repository to GitHub"
5+
end
6+
7+
steps do
8+
tip "If you have a 'railsbridge' folder on your computer or some other place you like to keep project files, `cd` to that directory and then follow the steps below."
9+
10+
step "Make a special new directory" do
11+
message "To get started on the project, you'll need to open up your command line. If you have a Mac, open up the Terminal app. If you're on a PC, look for a program called Command Prompt. You'll also need to know your GitHub user name and password. Wherever you see `[your-github-user-name]`, you'll replace that with your user name (and delete the braces: the `[` and `]`)."
12+
console "mkdir [your-github-user-name].github.io"
13+
message "`mkdir` stands for 'make directory.' You just made a new directory that you'll put your project files in."
14+
end
15+
16+
step "Initialize a new local git repository" do
17+
console "cd [your-github-user-name].github.io"
18+
message "You just changed directories and moved into the folder you just created."
19+
console "git init"
20+
message "You just initialized an empty repository, i.e. told git, 'I want to start a new project here.'"
21+
end
22+
23+
step "Make a commit" do
24+
console "touch index.html\ngit add index.html"
25+
message "This creates a blank, new file called 'index.html'. The next line tells git you want to stage the file."
26+
console "git commit -m 'first commit'"
27+
message "You just made an initial commit. (Think of it as a snapshot of your project that you can come back to later.)"
28+
end
29+
30+
step "Add GitHub as a remote" do
31+
message "You really do have to type your user name three times in the next command. Get ready for it."
32+
console "git remote add origin https://[your-github-user-name]@github.com/[your-github-user-name]/[your-github-user-name].github.io.git"
33+
34+
message "You just set up a 'remote' &mdash; a git repository somewhere else (in this case, on GitHub) that also holds your project files."
35+
end
36+
37+
step "Create a new repo via the GitHub UI" do
38+
tip "You can skip this step if you've created a ***[your-github-user-name].github.io*** page previously."
39+
message "Navigate to https://github.com/[your-github-user-name]/"
40+
message "Click 'Create a new repo' in the upper right"
41+
img :src => "img/github_create_repo.png"
42+
message "Type **[your-github-user-name].github.io** into the 'Repository name' box"
43+
img :src => "img/github_name_your_repo.png"
44+
45+
important "Do not choose 'Initialize this repository with a README' when creating the repo."
46+
end
47+
48+
step "Push your code to GitHub" do
49+
message "Now, push the new file you just committed to GitHub."
50+
console 'git push -u origin master'
51+
message "You'll probably be prompted to type your GitHub password at this point. After you do, you'll have just pushed your project to GitHub's servers!"
52+
important "If you have existing content in your GitHub Pages repo, this command will fail, and you will have to do a `git push -uf origin master` instead. Verify with a volunteer first that you're doing the right thing."
53+
end
54+
55+
step do
56+
message "Woohoo!!! Take a breath and wait a few minutes."
57+
message "Since you gave your GitHub repository a special name (in the format [your-github-user-name].github.io), GitHub will automatically take the contents of this one repository and make them your personal web page on GitHub. However, there's a small lag between the first push and being able to see your content on the web."
58+
message "In a few minutes time, when you visit [your-github-user-name].github.io in a browser, you should see a blank white page: this is great! You're looking at the index.html file you just created, now live on the web!"
59+
end
60+
end
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
goals do
2+
goal "Commit your changes to locally"
3+
goal "Push your changes to GitHub"
4+
end
5+
6+
step "Commit any pending changes to git" do
7+
message "GitHub will only receive the files we've committed into our local git repository. So we need to make sure all changed files have been committed."
8+
console "git status"
9+
message "`git status` shows you any pending changes you've created. If it has no output, you're already ready to deploy! Otherwise..."
10+
11+
console <<-SHELL
12+
git add .
13+
git commit -m "Some helpful message for your future self"
14+
SHELL
15+
message "Your commit message should reference whatever your outstanding changes are: something like 'added new cat picture'."
16+
end
17+
18+
step "Push changes to GitHub" do
19+
console "git push origin master"
20+
message "This takes all changes you've committed locally and pushes them to GitHub."
21+
end
22+
23+
step "Visit your site" do
24+
message "Go to your browser and navigate to **[your-github-user-name].github.io**"
25+
message "You should see the changes you made, but ON THE INTERNET!"
26+
end
27+
28+
29+
explanation do
30+
message <<-MARKDOWN
31+
32+
## What is Git?
33+
34+
Git is an open-source tool for tracking and managing changes to source code. If you've
35+
used tools like SVN or CVS, you can use Git to do the same things.
36+
37+
Git is not required for front end development at all &mdash; some people use other source
38+
control tools like SVN, and there are wild and crazy coders who don't use source control
39+
at all.
40+
41+
### But here are some good reasons to use a source control system:
42+
43+
* You can commit different/earlier versions of a project, and get them back
44+
later if you change your mind.
45+
* It's easy to also copy these versions to another server or computer, so you
46+
have a backup if your laptop is stolen or your hard drive gets damaged.
47+
* Other coders can more easily work on a project with you. Source control
48+
systems have an automated way to 'merge' or combine changed files together.
49+
50+
### And there are some neat things about Git specifically:
51+
52+
* Git is distributed. Each person or computer working on the project has a full
53+
copy of it. There isn't a remote server you have to connect to that has the
54+
'official' copy somewhere.
55+
* Git makes it easy to 'branch' or work separately for a while on an alternate
56+
version of the project, and then 'merge' those changes back in if you want to.
57+
* Git is ultra-powerful, and even many experienced developers are mystified
58+
by its wily ways.
59+
60+
## What is GitHub?
61+
62+
GitHub is a web application that will store copies of your git repositories for you.
63+
It's a convenient place to keep a backup of your projects, and it has a nice-looking
64+
web interface that makes it easy to see your files and changes.
65+
66+
Projects that you make public (i.e. open source) can be stored on GitHub for free.
67+
68+
MARKDOWN
69+
end

sites/en/frontend/add_more_elements.step

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ Now that you know the basics of working with HTML, the trickiest part is remembe
6060
MARKDOWN
6161
end
6262

63-
insert 'consider_deploying_to_github'
63+
insert 'consider_deploying_to_github_again'
6464

6565
next_step 'make_columns'
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
h2 do
2+
span "If you have already deployed your app to GitHub, go on to "
3+
a 'Deploying to GitHub again', href: "deploying_to_github_pages_again"
4+
span "."
5+
end
6+
7+
important "If you have any problems with these steps, ask a volunteer for help. If you don't know if you have Git installed or have a GitHub account, it's okay to do these steps later instead."
8+
9+
insert '_deploying_to_github'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
h2 do
2+
span "If you haven't deployed your app to GitHub yet, start at "
3+
a 'Deploying to GitHub', href: 'deploying_to_github_pages'
4+
span "."
5+
end
6+
7+
important "If you have any problems with these steps, ask a volunteer for help. If you don't know if you have Git installed or have a GitHub account, it's okay to do these steps later instead."
8+
9+
insert '_deploying_to_github'
10+
11+
insert '_deploying_to_github_again'

sites/en/frontend/deploying_to_github_pages.step

Lines changed: 0 additions & 146 deletions
This file was deleted.

sites/en/frontend/make_columns.step

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ it. Here are two different designers' interpretations of the same HTML:
4444
MARKDOWN
4545
end
4646

47-
insert 'consider_deploying_to_github'
47+
insert 'consider_deploying_to_github_again'
4848

4949
next_step "basic_javascript"

0 commit comments

Comments
 (0)