Skip to content

Commit

Permalink
Set up github actions (#345)
Browse files Browse the repository at this point in the history
* Set up drone pipeline

* Only include our supported versions of node

* Cache NPM

* Release workflow

* Remove drone

* Add CODEOWNERS

* Tweak workflow names

* Add tests badge to README
  • Loading branch information
afischer authored Feb 23, 2023
1 parent a7cd627 commit ca0c81b
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 137 deletions.
135 changes: 0 additions & 135 deletions .drone.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ assignees: ''
---

<!--
If you have a question about how to do something with Library, you can open an issue and we will try to point you in the right direction. Before opening one of these, make sure to consult the demo site which has answers to many common questions: https://nyt-library-demo.herokuapp.com/
If you have a question about how to do something with Library, consider first posting to the
discussion board at https://github.com/nytimes/library/discussions. For more specific cases,
you can open an issue and we will try to point you in the right direction. Before opening one of
these, make sure to consult the demo site which has answers to many common questions: https://nyt-library-demo.herokuapp.com/
You can also submit questions to our Google group: https://groups.google.com/g/nyt-library-community
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: nytimes/library

- name: Build and push Docker image
uses: docker/build-push-action@4
with:
context: .
push: ${{ github.event_name != 'pull_request' }} # just to be safe
tags: ${{ steps.meta.outputs.tags }} # automatically tags with latest, version from tag
labels: ${{ steps.meta.outputs.labels }}
34 changes: 34 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main, gh-actions]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]

steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Test
run: npm test
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# any changes to workflows should be approved by project owners
./github/workflows @nytimes/interactive-news
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Library [![Build Status](https://cloud.drone.io/api/badges/nytimes/library/status.svg)](https://cloud.drone.io/nytimes/library) ![Supported node versions](https://img.shields.io/badge/dynamic/json?color=informational&label=node&query=%24.engines.node&url=https%3A%2F%2Fraw.neting.cc%2Fnytimes%2Flibrary%2Fmain%2Fpackage.json)
Library ![Supported node versions](https://img.shields.io/badge/dynamic/json?color=informational&label=node&query=%24.engines.node&url=https%3A%2F%2Fraw.neting.cc%2Fnytimes%2Flibrary%2Fmain%2Fpackage.json) [![Tests](https://github.com/nytimes/library/actions/workflows/test.yaml/badge.svg)](https://github.com/nytimes/library/actions/workflows/test.yaml)
========

A collaborative newsroom documentation site, powered by Google Docs.
Expand Down

0 comments on commit ca0c81b

Please sign in to comment.