Skip to content

Commit c7b8378

Browse files
Updates instructions in README
1 parent abc9c1e commit c7b8378

File tree

1 file changed

+28
-40
lines changed

1 file changed

+28
-40
lines changed

README.md

+28-40
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You’ll be asked to login again, and afterwards your token will be displayed li
2424
token: a142e09a6b13a21be512b141241c7123
2525
```
2626

27-
![Getting your token from the Surge CLI.](https://surge.sh/images/help/integrating-with-circleci.gif)
27+
![Getting your token from the Surge CLI.](http://localhost:5001/images/help/integrating-with-circleci.gif)
2828

2929
### Adding Surge as a `devDependency` to a `package.json` file
3030

@@ -44,79 +44,67 @@ Next, run this command to save Surge as a `devDependency`, so CircleCI will inst
4444
npm install --save-dev surge
4545
```
4646

47-
<!--
47+
#### Double-check your tests
4848

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-
![Add the GitHub repository your project is stored in. This example is using the surge-sh/example-circleci repo.](https://surge.sh/images/help/integrating-with-circleci-2.png)
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`.
5450

55-
### Define your Setup and Test Commands
51+
You can add tests or just clear this out of your `package.json` file entirely, changing:
5652

57-
Now you’re ready to run `surge` on CircleCI. Your CircleCI setup commands run before the deployment command.
58-
59-
![](https://surge.sh/images/help/integrating-with-circleci-3.png)
53+
```sh
54+
"scripts": {
55+
"test": "echo \"Error: no test specified.\" && exit 1"
56+
}
57+
```
6058

61-
Your setup commands should look like this:
59+
…into:
6260

6361
```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+
}
7065
```
7166

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.
7368

74-
```sh
75-
# Run your tests (if you have any)
76-
npm test
69+
### Add your project’s repository to CircleCI
7770

78-
# Run Surge
79-
surge --project ./ --domain example-circleci.surge.sh
80-
```
71+
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:
8172

82-
### Add Environment Variables
73+
![Add the GitHub repository your project is stored in. This example is using the surge-sh/example-circleci repo.](http://localhost:5001/images/help/integrating-with-circleci-2.png)
8374

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
8576

86-
![Environment Variables is listed under your project settings.](https://surge.sh/images/help/integrating-with-circleci-4.png)
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:
8778

8879
Create one environment variable called:
8980

9081
```
9182
SURGE_LOGIN
9283
```
9384

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+
![Adding SURGE_TOKEN` as an environment variable.](http://localhost:5001/images/help/integrating-with-circleci-3.png)
88+
89+
Next, add another environment variable called:
9590

9691
```
9792
SURGE_TOKEN
9893
```
9994

10095
…and set it to your Surge token.
10196

102-
![Adding `SURGE_LOGIN` and `SURGE_TOKEN` as environment variables.](https://surge.sh/images/help/integrating-with-circleci-5.png)
97+
![Adding SURGE_TOKEN` as an environment variable.](http://localhost:5001/images/help/integrating-with-circleci-4.png)
10398

104-
### Add a deployment script
99+
## Run Surge on CircleCI
105100

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 run your deployment step with `surge` on CircleCI.
107102

108-
![Adding a custom script for continuous deployment.](https://surge.sh/images/help/integrating-with-circleci-6.png)
109103

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+
***
115105

116106
Now, when you push your project to GitHub again, this command will be run and your project will get published automatically.
117107

118-
-->
119-
120108
## License
121109

122110
[The MIT License (MIT)](LICENSE.md)

0 commit comments

Comments
 (0)