Skip to content

Commit dd7c60c

Browse files
authored
Migrate from CircleCI to GitHub Actions (#134)
* add support for gh actions * fix linting issues
1 parent a38e4d3 commit dd7c60c

File tree

73 files changed

+615
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+615
-302
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@
5858
{
5959
"ignore": [
6060
"components",
61+
"hooks",
6162
"images",
6263
"layouts",
6364
"pages",
64-
"templates",
6565
"styles",
6666
"svg",
67+
"templates",
6768
"utils"
6869
]
6970
}

.github/workflows/production.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Production
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
env:
9+
ALGOLIA_ADMIN_KEY: ${{ secrets.PROD_CI_ALGOLIA_ADMIN_KEY })
10+
AWS_ACCESS_KEY_ID: ${{ secrets.PROD_CI_AWS_ACCESS_KEY }}
11+
AWS_CLOUDFRONT_DISTRIBUTION_ID: $({ secrets.PROD_CI_AWS_CLOUDFRONT_DISTRIBUTION_ID})
12+
AWS_REGION: 'eu-west-1'
13+
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_CI_AWS_SECRET_KEY }}
14+
BUCKET_NAME: $({ secrets.PROD_CI_BUCKET_NAME })
15+
BUCKET_REGION: $({ secrets.PROD_CI_BUCKET_REGION })
16+
GATSBY_ALGOLIA_APP_ID: $({ secrets.PROD_CI_GATSBY_ALGOLIA_APP_ID })
17+
GATSBY_ALGOLIA_INDEX_NAME: $({ secrets.PROD_CI_GATSBY_ALGOLIA_INDEX_NAME })
18+
GATSBY_ALGOLIA_SEARCH_ONLY_KEY: $({ secrets.PROD_CI_GATSBY_ALGOLIA_SEARCH_ONLY_KEY })
19+
GATSBY_DEFAULT_APP_URL: https://app.$({ secrets.PROD_CI_MAIN_URL })
20+
GATSBY_DEFAULT_BLOG_URL: https://$({ secrets.PROD_CI_MAIN_URL })/blog
21+
GATSBY_DEFAULT_DOC_URL: https://$({ secrets.PROD_CI_MAIN_URL })/docs
22+
GATSBY_DEFAULT_MAIN_URL: https://$({ secrets.PROD_CI_MAIN_URL })
23+
GATSBY_DRIFT_API: $({ secrets.PROD_CI_GATSBY_DRIFT_API })
24+
GATSBY_GOOGLE_API_KEY: $({ secrets.PROD_CI_GATSBY_GOOGLE_API_KEY })
25+
26+
jobs:
27+
lint:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout project
31+
uses: actions/checkout@v2
32+
- name: Use Node.js 12.xs
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: '12.x'
36+
registry-url: 'https://registry.npmjs.org'
37+
- name: Restore cache
38+
uses: actions/cache@v2
39+
with:
40+
path: '**/node_modules'
41+
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
42+
- name: Install dependencies
43+
run: npm install
44+
- name: Run linter
45+
run: |
46+
npm run lint
47+
npm run lint:prose
48+
build:
49+
runs-on: ubuntu-latest
50+
needs:
51+
- lint
52+
steps:
53+
- name: Checkout project
54+
uses: actions/checkout@v2
55+
- name: Use Node.js 12.xs
56+
uses: actions/setup-node@v1
57+
with:
58+
node-version: '12.x'
59+
registry-url: 'https://registry.npmjs.org'
60+
- name: Restore cache
61+
uses: actions/cache@v2
62+
with:
63+
path: '**/node_modules'
64+
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
65+
- name: Install dependencies
66+
run: npm install
67+
- name: Build project
68+
run: npm run build
69+
- name: Upload artifact
70+
uses: actions/upload-artifact@v2
71+
with:
72+
name: k6-docs
73+
path: public/
74+
deploy-to-production:
75+
runs-on: ubuntu-latest
76+
needs:
77+
- lint
78+
- build
79+
steps:
80+
- name: Download artifact
81+
uses: actions/download-artifact@v2
82+
with:
83+
name: k6-docs
84+
path: public/
85+
- name: Install AWS CLI dependencies
86+
run: sudo apt-get update && sudo apt-get -y install python-pip python-dev
87+
- name: Install AWS CLI
88+
run: sudo pip install awscli
89+
- name: Deploy
90+
run: npm run deploy

.github/workflows/staging.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Staging
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
env:
9+
ALGOLIA_ADMIN_KEY: ${{ secrets.STAGING_CI_ALGOLIA_ADMIN_KEY })
10+
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_CI_AWS_ACCESS_KEY }}
11+
AWS_CLOUDFRONT_DISTRIBUTION_ID: $({ secrets.STAGING_CI_AWS_CLOUDFRONT_DISTRIBUTION_ID})
12+
AWS_REGION: 'eu-west-1'
13+
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_CI_AWS_SECRET_KEY }}
14+
BUCKET_NAME: $({ secrets.STAGING_CI_BUCKET_NAME })
15+
BUCKET_REGION: $({ secrets.STAGING_CI_BUCKET_REGION })
16+
GATSBY_ALGOLIA_APP_ID: $({ secrets.STAGING_CI_GATSBY_ALGOLIA_APP_ID })
17+
GATSBY_ALGOLIA_INDEX_NAME: $({ secrets.STAGING_CI_GATSBY_ALGOLIA_INDEX_NAME })
18+
GATSBY_ALGOLIA_SEARCH_ONLY_KEY: $({ secrets.STAGING_CI_GATSBY_ALGOLIA_SEARCH_ONLY_KEY })
19+
GATSBY_DEFAULT_APP_URL: https://app.$({ secrets.STAGING_CI_MAIN_URL })
20+
GATSBY_DEFAULT_BLOG_URL: https://$({ secrets.STAGING_CI_MAIN_URL })/blog
21+
GATSBY_DEFAULT_DOC_URL: https://$({ secrets.STAGING_CI_MAIN_URL })/docs
22+
GATSBY_DEFAULT_MAIN_URL: https://$({ secrets.STAGING_CI_MAIN_URL })
23+
GATSBY_DRIFT_API: $({ secrets.STAGING_CI_GATSBY_DRIFT_API })
24+
GATSBY_GOOGLE_API_KEY: $({ secrets.STAGING_CI_GATSBY_GOOGLE_API_KEY })
25+
jobs:
26+
lint:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout project
30+
uses: actions/checkout@v2
31+
- name: Use Node.js 12.xs
32+
uses: actions/setup-node@v1
33+
with:
34+
node-version: '12.x'
35+
registry-url: 'https://registry.npmjs.org'
36+
- name: Restore cache
37+
uses: actions/cache@v2
38+
with:
39+
path: '**/node_modules'
40+
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
41+
- name: Install dependencies
42+
run: npm install
43+
- name: Run linter
44+
run: |
45+
npm run lint
46+
npm run lint:prose
47+
build:
48+
runs-on: ubuntu-latest
49+
needs:
50+
- lint
51+
steps:
52+
- name: Checkout project
53+
uses: actions/checkout@v2
54+
- name: Use Node.js 12.xs
55+
uses: actions/setup-node@v1
56+
with:
57+
node-version: '12.x'
58+
registry-url: 'https://registry.npmjs.org'
59+
- name: Restore cache
60+
uses: actions/cache@v2
61+
with:
62+
path: '**/node_modules'
63+
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
64+
- name: Install dependencies
65+
run: npm install
66+
- name: Build project
67+
run: npm run build
68+
- name: Upload artifact
69+
uses: actions/upload-artifact@v2
70+
with:
71+
name: k6-docs
72+
path: public/
73+
deploy-to-staging:
74+
runs-on: ubuntu-latest
75+
needs:
76+
- lint
77+
- build
78+
steps:
79+
- name: Download artifact
80+
uses: actions/download-artifact@v2
81+
with:
82+
name: k6-docs
83+
path: public/
84+
- name: Install AWS CLI dependencies
85+
run: sudo apt-get update && sudo apt-get -y install python-pip python-dev
86+
- name: Install AWS CLI
87+
run: sudo pip install awscli
88+
- name: Deploy
89+
run: npm run deploy

src/components/blocks/cta/cta.view.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import React from 'react';
2-
3-
import { Heading } from 'components/shared/heading';
41
import { Button } from 'components/shared/button';
52
import { navigate } from 'gatsby';
3+
import React from 'react';
64

75
import styles from './cta.module.scss';
8-
96
import ButtonBg from './svg/button-bg.inline.svg';
107

118
export const CTA = ({
@@ -16,7 +13,6 @@ export const CTA = ({
1613
buttonRef,
1714
buttonTarget,
1815
openDrift,
19-
openDriftMessage,
2016
themeLight,
2117
}) => (
2218
<section className={styles.wrapper}>
@@ -32,6 +28,7 @@ export const CTA = ({
3228

3329
<div className={styles.buttonWrapper}>
3430
{themeLight && <ButtonBg className={styles.buttonBg} />}
31+
{/* eslint-disable-next-line no-nested-ternary */}
3532
{openDrift ? (
3633
<Button
3734
className={styles.ctaButton}

src/components/blocks/featured-post-card/featured-post-card.view.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import React from 'react';
2-
import Img from 'gatsby-image';
3-
import styles from './featured-post-card.module.scss';
41
import classNames from 'classnames';
5-
import { format } from 'date-fns';
62
import { Button } from 'components/shared/button';
73
import { Heading } from 'components/shared/heading';
4+
import { format } from 'date-fns';
5+
import Img from 'gatsby-image';
6+
import React from 'react';
87
import { trimToLengthWithEllipsis } from 'utils';
98

9+
import styles from './featured-post-card.module.scss';
10+
1011
export const FeaturedPostCard = ({
1112
gatsbyImageData,
1213
covertext,

src/components/blocks/footer-column/footer-column.component.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from 'react';
21
import classNames from 'classnames';
2+
import React from 'react';
33

44
import styles from './footer-column.module.scss';
55

6-
const getClassNames = docLayout =>
6+
const getClassNames = (docLayout) =>
77
classNames(
88
{ 'col-lg-3': !!docLayout },
99
{ 'col-md-3': !docLayout },
@@ -16,7 +16,7 @@ export const FooterColumn = ({ title, items, docLayout }) => {
1616
<div className={`${getClassNames(docLayout)}`}>
1717
<h3 className={styles.navColumnTitle}>{title}</h3>
1818
<ul className={styles.navColumnList}>
19-
{items.map(item => (
19+
{items.map((item) => (
2020
<li className={styles.navColumnItem}>
2121
<a className={styles.navColumnLink} href={`${item.url}`}>
2222
{item.title}

src/components/blocks/footer/footer.view.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Link } from 'gatsby';
22
import React from 'react';
33
import Logo from 'svg/logo.inline.svg';
4+
import { blog, main, docs } from 'utils/urls';
45

56
import styles from './footer.module.scss';
67
import GithubLogo from './svg/github.inline.svg';
@@ -9,8 +10,6 @@ import TwitterLogo from './svg/twitter.inline.svg';
910

1011
import './footer.scss';
1112

12-
import { blog, main, docs } from 'utils/urls';
13-
1413
export const Footer = () => (
1514
<footer className={styles.wrapper}>
1615
<div className={styles.topSection}>

src/components/blocks/header/burger/header-burger.view.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22

33
import styles from './header-burger.module.scss';
44

5-
65
export const Burger = ({ onClick }) => (
7-
<button className={styles.wrapper} type={'button'} onClick={onClick}/>
6+
<button className={styles.wrapper} type={'button'} onClick={onClick} />
87
);

src/components/blocks/header/header.view.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import styles from './header.module.scss';
55
export const Header = ({ children }) => (
66
<header className={styles.wrapper}>
77
<div className={'container'}>
8-
<div className={'row align-items-center'}>
9-
{children}
10-
</div>
8+
<div className={'row align-items-center'}>{children}</div>
119
</div>
1210
</header>
1311
);

src/components/blocks/header/logo/header-logo.view.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import React from 'react';
21
import { Link } from 'gatsby';
2+
import React from 'react';
33
import Logo from 'svg/logo.inline.svg';
4+
import { main } from 'utils/urls';
45

56
import styles from './header-logo.module.scss';
67

7-
import { main } from 'utils/urls';
8-
98
export const HeaderLogo = ({ disableLink = false, theme = 'default' }) => {
109
if (disableLink) {
1110
return <Logo className={styles.logo} />;
12-
} else if (theme === 'doc') {
11+
}
12+
if (theme === 'doc') {
1313
return (
1414
<Link className={`${styles.wrapper} ${styles.wrapper_doc}`} to={`/`}>
1515
<Logo className={styles.logo} />

0 commit comments

Comments
 (0)