1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2025-02-14 21:10:41 +01:00

Merge pull request #185 from kremalicious/feature/github-actions

Setup GitHub Actions
This commit is contained in:
Matthias Kretschmann 2019-11-14 00:32:43 +01:00 committed by GitHub
commit f04763c1b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 2 deletions

View File

@ -1 +1 @@
#GITHUB_TOKEN=
#GATSBY_GITHUB_TOKEN=

41
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install Dependencies
run: |
npm ci
- name: Test
run: |
npm test
- name: Build
run: |
npm run build --if-present
env:
CI: true
GATSBY_GITHUB_TOKEN: ${{ secrets.GATSBY_GITHUB_TOKEN }}

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ npm-debug.log*
yarn-debug.log*
plugins/gatsby-plugin-matomo
coverage
.env

View File

@ -29,7 +29,7 @@ function truncate(n, useWordBoundary) {
const gitHubConfig = {
headers: {
'User-Agent': 'kremalicious/portfolio',
Authorization: `token ${process.env.GITHUB_TOKEN}`
Authorization: `token ${process.env.GATSBY_GITHUB_TOKEN}`
}
}