Skip to content

Commit 78b7082

Browse files
authored
ci: switch to GitHub Actions (api-platform#1261)
* ci: switch to GitHub Actions * add token to retrieve contributors
1 parent fe9f98e commit 78b7082

File tree

3 files changed

+85
-40
lines changed

3 files changed

+85
-40
lines changed

.github/workflows/cd.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy Website
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '*.*'
8+
- ci/github-actions
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
15+
- name: Checkout the website
16+
uses: actions/checkout@v2
17+
with:
18+
repository: api-platform/website
19+
ref: main
20+
21+
- name: Get yarn cache directory path
22+
id: yarn-cache-dir-path
23+
run: echo "::set-output name=dir::$(yarn cache dir)"
24+
25+
- uses: actions/cache@v2
26+
id: yarn-cache
27+
with:
28+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
29+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
30+
restore-keys: |
31+
${{ runner.os }}-yarn-
32+
33+
- name: Install deps
34+
run: yarn install
35+
36+
- name: Retrieve docs
37+
run: bin/retrieve-documentation
38+
39+
- name: Build website
40+
env:
41+
GITHUB_KEY: ${{ secrets.CONTRIBUTORS_GITHUB_TOKEN }}
42+
run: yarn gatsby build
43+
44+
- name: Deploy
45+
uses: peaceiris/actions-gh-pages@v3
46+
with:
47+
github_token: ${{ secrets.GITHUB_TOKEN }}
48+
publish_dir: ./public
49+
cname: api-platform.com

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Lint
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
build:
9+
name: Lint
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Lint
19+
uses: github/super-linter@v3
20+
env:
21+
VALIDATE_ALL_CODEBASE: false
22+
DEFAULT_BRANCH: main
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- uses: actions/cache@v2
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
32+
- name: Install Proselint
33+
run: pip install --quiet --user proselint
34+
35+
- name: Run Proselint
36+
run: find . -name '*.md' -exec proselint {} \;

.travis.yml

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

0 commit comments

Comments
 (0)