Skip to content

Commit b7df8ea

Browse files
authored
Merge pull request #104 from nickmccurdy/ci
Switch CI from Travis to GitHub Actions
2 parents 07dadac + 602afca commit b7df8ea

File tree

9 files changed

+64
-269
lines changed

9 files changed

+64
-269
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily

.github/workflows/CI.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [source]
6+
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Setup Node
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: 8
28+
cache: yarn
29+
- name: Setup Pages
30+
uses: actions/configure-pages@v2
31+
- name: Install dependencies
32+
run: yarn
33+
- name: Build with DocPad
34+
run: yarn build
35+
- name: Upload artifact
36+
uses: actions/upload-pages-artifact@v1
37+
with:
38+
path: out
39+
40+
deploy:
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
runs-on: ubuntu-latest
45+
needs: build
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v1

.travis.yml

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

Gruntfile.js

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,9 @@ module.exports = function (grunt) {
33

44
grunt.loadNpmTasks('grunt-contrib-clean');
55
grunt.loadNpmTasks('grunt-contrib-copy');
6-
grunt.loadNpmTasks('grunt-gh-pages');
76

87
grunt.loadTasks('./tasks');
98

10-
function getDeployMessage() {
11-
var ret = '\n\n';
12-
if (process.env.TRAVIS !== 'true') {
13-
ret += 'did not run on travis-ci';
14-
return ret;
15-
}
16-
ret += 'branch: ' + (process.env.TRAVIS_BRANCH || '<unknown>') + '\n';
17-
ret += 'SHA: ' + (process.env.TRAVIS_COMMIT || '<unknown>') + '\n';
18-
ret += 'range SHA: ' + (process.env.TRAVIS_COMMIT_RANGE || '<unknown>') + '\n';
19-
ret += 'build id: ' + (process.env.TRAVIS_BUILD_ID || '<unknown>') + '\n';
20-
ret += 'build number: ' + (process.env.TRAVIS_BUILD_NUMBER || '<unknown>') + '\n';
21-
return ret;
22-
}
239
grunt.initConfig({
2410
pkg: grunt.file.readJSON('package.json'),
2511
clean: {
@@ -33,31 +19,6 @@ module.exports = function (grunt) {
3319
dest: 'out/'
3420
}
3521
},
36-
'gh-pages': {
37-
options: {
38-
base: 'out',
39-
branch: 'master'
40-
},
41-
publish: {
42-
options: {
43-
repo: 'https://github.com/DefinitelyTyped/definitelytyped.github.io.git',
44-
message: 'publish (cli)'
45-
},
46-
src: ['**']
47-
},
48-
deploy: {
49-
options: {
50-
repo: 'https://' + process.env.GH_TOKEN + '@github.com/DefinitelyTyped/definitelytyped.github.io.git',
51-
message: 'publish (auto)' + getDeployMessage(),
52-
silent: true,
53-
user: {
54-
name: 'dt-bot',
55-
56-
}
57-
},
58-
src: ['**']
59-
}
60-
},
6122
docpad: {
6223
options: require('./docpad'),
6324
generate: {
@@ -75,18 +36,6 @@ module.exports = function (grunt) {
7536
}
7637
});
7738

78-
grunt.registerTask('check-deploy', function() {
79-
this.requires(['build']);
80-
81-
if (process.env.TRAVIS === 'true' && process.env.TRAVIS_PULL_REQUEST === 'false') {
82-
grunt.log.writeln('executing deployment');
83-
grunt.task.run('gh-pages:deploy');
84-
}
85-
else {
86-
grunt.log.writeln('skipping deployment');
87-
}
88-
});
89-
9039
//
9140
grunt.registerTask('prep', 'Clean and prepare.', [
9241
'clean:out',
@@ -109,15 +58,5 @@ module.exports = function (grunt) {
10958
'copy:rootfiles'
11059
]);
11160

112-
grunt.registerTask('publish', 'Build and push to master using CLI.', [
113-
'build',
114-
'gh-pages:publish'
115-
]);
116-
117-
grunt.registerTask('deploy', 'Build with production env for bot.', [
118-
'build',
119-
'check-deploy'
120-
]);
121-
12261
grunt.registerTask('default', ['build']);
12362
};

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# definitelytyped.github.io [![Build Status](https://travis-ci.org/DefinitelyTyped/definitelytyped.github.io.svg?branch=source)](https://travis-ci.org/DefinitelyTyped/definitelytyped.github.io)
1+
# definitelytyped.github.io
22

33
> Website content for [definitelytyped.org](http://definitelytyped.org).
44
55
The [master](https://github.com/DefinitelyTyped/definitelytyped.github.io/tree/master) branch holds live github.io content generated from the [source](https://github.com/DefinitelyTyped/definitelytyped.github.io/tree/source) branch.
66

7-
The site build with [Grunt](http://www.gruntjs.com) and generated using [docpad](http://docpad.org), a static site generator complete with watch tasks, development server with LiveReload and [many plugins](http://docpad.org/docs/plugins). Publishing happens using [grunt-gh-pages](https://github.com/tschaub/grunt-gh-pages).
7+
The site build with [Grunt](http://www.gruntjs.com) and generated using [docpad](http://docpad.org), a static site generator complete with watch tasks, development server with LiveReload and [many plugins](http://docpad.org/docs/plugins).
88

99

1010
## Edit online
@@ -32,7 +32,7 @@ If you like to use your own tools you can follow these steps:
3232

3333
1. Send a pull request to the `source` branch.
3434

35-
1. After review a committer will merge and Travis-CI will republish the site.
35+
1. After review a committer will merge and GitHub Actions will republish the site.
3636

3737
1. See below for the steps to get a local preview (this is not essential for simple markdown edits).
3838

@@ -85,9 +85,9 @@ Use grunt to run various commands.
8585

8686
1. If you like some feedback first then use a fork (or branch).
8787

88-
1. The every commit that lands on `source` will automatically be rebuild and deployed via Travis-CI.
88+
1. The every commit that lands on `source` will automatically be rebuild and deployed via GitHub Actions.
8989

90-
1. Give Travis a minute or two to deploy the site, then verify your changes.
90+
1. Give GitHub Actions a minute or two to deploy the site, then verify your changes.
9191

9292
1. Optional: Fix some typos.
9393

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
],
2727
"scripts": {
2828
"test": "grunt test",
29-
"deploy": "grunt deploy"
29+
"build": "grunt build"
3030
},
3131
"dependencies": {},
3232
"devDependencies": {
@@ -38,7 +38,6 @@
3838
"docpad-plugin-livereload": "^2.6.0",
3939
"grunt": "^1.0.1",
4040
"grunt-cli": "^1.2.0",
41-
"grunt-gh-pages": "^2.0.0",
4241
"grunt-contrib-clean": "^1.1.0",
4342
"grunt-contrib-copy": "^1.0.0",
4443
"highlight.js": "^9.12.0",

src/documents/guides/pull-request.html.md.eco

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ If you need multiple tries to make it work then please flatten your commits so t
3030

3131
It is recommended to split your contributions for different JS packages into their own git branches so you can have multiple pending PR's.
3232

33-
## Travis CI for your DT fork
34-
35-
You can enable Travis for your own DT fork if you like: go to [Travis](https://travis-ci.org/) and sign-up for free if you haven't yet. Then go to your [account](https://travis-ci.org/profile) and enable your DT fork. This will run Travis same as on DT and allows you to experiment freely. You can review your fork's build status via the menu on the left side of the [Travis homepage](https://travis-ci.org/) after you enabled the hook AND pushed some code to the repo.
36-
3733
## Large contributions and changes
3834

3935
If you plan to start a new definition make sure to check the issues first and/or leave a message that you are working on it so you're not do duplicating work. Coordination with fellow users is always recommended.

src/documents/pages/website-contributions.html.md.eco

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ The repository with the site content is located at [github.com/DefinitelyTyped/d
1717

1818
This site is generated using [docpad](http://docpad.org), a static site generator complete with watch tasks and a LiveReload development server.
1919

20-
The automated build runs [Grunt](http://www.gruntjs.com) on [Travis-CI](https://travis-ci.org/DefinitelyTyped/definitelytyped.github.io.svg?branch=source).
20+
The automated build runs [Grunt](http://www.gruntjs.com) on [GitHub Actions](https://github.com/DefinitelyTyped/definitelytyped.github.io/actions).
2121

2222
See the [readme](https://github.com/DefinitelyTyped/definitelytyped.github.io/blob/source/README.md) for more detailed information and feel free to post a [ticket](https://github.com/DefinitelyTyped/definitelytyped.github.io/issues) if you have any questions.

0 commit comments

Comments
 (0)