Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add dev-image job #177

Merged
merged 6 commits into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/dev-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Dev Image CI'

on:
push:
branches:
- master
paths:
- '.github/workflows/dev-image.yml'
- '.dockerignore'
- '.nvmrc'
- 'Dockerfile'
- 'Makefile'
pull_request:
types:
- opened
- synchronize
paths:
- '.github/workflows/dev-image.yml'
- '.dockerignore'
- '.nvmrc'
- 'Dockerfile'
- 'Makefile'

jobs:
skipci:
runs-on: ubuntu-18.04
steps:
- run: echo "[skip ci] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"

dev-image-test:
runs-on: ubuntu-18.04
if: contains(github.event.head_commit.message, '[skip ci]') == false
steps:
- uses: actions/checkout@v2
- run: make build
- run: make cirun cmd="npm ci"
- run: make ciall
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ IMAGE_NAME := actions_github_pages_dev:latest
NODE_VERSION := $(shell cat ./.nvmrc)
DOCKER_BUILD := docker build . -t $(IMAGE_NAME) --build-arg NODE_VERSION=$(NODE_VERSION)
DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/root/.gitconfig $(IMAGE_NAME)
DOCKER_RUN_CI := docker run --rm -v ${PWD}:/repo $(IMAGE_NAME)


.PHONY: build
Expand All @@ -14,6 +15,10 @@ build:
run:
$(DOCKER_RUN) $(cmd)

.PHONY: cirun
cirun:
$(DOCKER_RUN_CI) $(cmd)

.PHONY: test
test:
$(DOCKER_RUN) npm test
Expand All @@ -25,3 +30,7 @@ commit:
.PHONY: all
all:
$(DOCKER_RUN) npm run all

.PHONY: ciall
ciall:
$(DOCKER_RUN_CI) npm run all