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
Copy file name to clipboardExpand all lines: README.md
+28-40
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ You’ll be asked to login again, and afterwards your token will be displayed li
24
24
token: a142e09a6b13a21be512b141241c7123
25
25
```
26
26
27
-

27
+

28
28
29
29
### Adding Surge as a `devDependency` to a `package.json` file
30
30
@@ -44,79 +44,67 @@ Next, run this command to save Surge as a `devDependency`, so CircleCI will inst
44
44
npm install --save-dev surge
45
45
```
46
46
47
-
<!--
47
+
#### Double-check your tests
48
48
49
-
### Add your project’s repository to CircleCI
50
-
51
-
Now you can login and setup a new project on CircleCI. Add your project’s GitHub repository to your CircleCI projects:
52
-
53
-

49
+
If you needed to add a new `package.json` file, you’ll want to make one small change. It’s possible your initial build will fail if you don’t have any tests, or if you have the default test command in your `package.json`.
54
50
55
-
### Define your Setup and Test Commands
51
+
You can add tests or just clear this out of your `package.json` file entirely, changing:
56
52
57
-
Now you’re ready to run `surge` on CircleCI. Your CircleCI setup commands run before the deployment command.
"test": "echo \"Error: no test specified.\" && exit 1"
56
+
}
57
+
```
60
58
61
-
Your setup commands should look like this:
59
+
…into:
62
60
63
61
```sh
64
-
# Install the latest version of Node.js
65
-
nvm install stable
66
-
nvm use stable
67
-
68
-
# Install Surge as a devDependency
69
-
npm install
62
+
"scripts": {
63
+
"test": "echo \"Error: no test specified.\""
64
+
}
70
65
```
71
66
72
-
After you push you successfully to your repository, CircleCI will run your Test Pipeline commands, which is when you can publish your project with Surge:
67
+
Commit this change, and push it to your repo. Now, even if you don’t have tests, CircleCI will be able to move onto the deployment command.
Now you can login and setup a new project on CircleCI. Choose the GitHub organisation your project is in (_surge-sh_ in this example) and then build your project’s GitHub repository:
81
72
82
-
### Add Environment Variables
73
+

83
74
84
-
Press _Environment Variables_ next, and you’ll be able to secretly add your email address and token so CircleCI can login to Surge for you:
75
+
### Add Environment Variables
85
76
86
-

77
+
Choose _Environment Variables_ from your project settings, and you’ll be able to secretly add your email address and token so CircleCI can login to Surge for you:
87
78
88
79
Create one environment variable called:
89
80
90
81
```
91
82
SURGE_LOGIN
92
83
```
93
84
94
-
…and set it to the email address you use with Surge. Next, add another environment variable called:
85
+
…and set it to the email address you use with Surge.
86
+
87
+

88
+
89
+
Next, add another environment variable called:
95
90
96
91
```
97
92
SURGE_TOKEN
98
93
```
99
94
100
95
…and set it to your Surge token.
101
96
102
-

97
+

103
98
104
-
### Add a deployment script
99
+
##Run Surge on CircleCI
105
100
106
-
Push to your repository, and your Setup and Test commands should run, triggering your tests to run on CircleCI. Now, CircleCI will let you move onto adding a script for Continuous Deployment. You can press the button labeled _Set up Continuous Deployment_ or access this section under your project settings:
101
+
Now you’re ready to runyour deployment step with `surge`on CircleCI.
107
102
108
-

109
103
110
-
Add a _Custom Script_ and enter the command you want to run with Surge, for example:
111
-
112
-
```sh
113
-
surge --project ./ example-circleci.surge.sh
114
-
```
104
+
***
115
105
116
106
Now, when you push your project to GitHub again, this command will be run and your project will get published automatically.
0 commit comments