Skip to content

Commit

Permalink
add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
South-Paw committed Aug 26, 2020
1 parent ce101ef commit 01afcb1
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Pull Request CI

on:
pull_request:
types:
- opened
- synchronize

jobs:
deployDraftOnAnyPullRequest:
name: Deploy draft to Netlify
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v1

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build Storybook
run: yarn build:storybook

- name: Deploy draft to Netlify
uses: South-Paw/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
build-dir: './storybook-static'
draft: true
comment-on-pull-request: true
72 changes: 72 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Push CI

on: [push]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: yarn lint

test:
name: Test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test
env:
CI: true
run: yarn test

build:
name: Build
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build Package
run: yarn build

deployDraftOnMasterCommit:
name: Deploy draft to Netlify
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build Storybook
run: yarn build:storybook

- name: Deploy draft build to Netlify
uses: South-Paw/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
build-dir: './storybook-static'
draft: true
comment-on-commit: true
29 changes: 29 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release CI

on:
release:
types:
- created

jobs:
deployOnMasterRelease:
name: Publish release to Netlify
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- name: Checkout repository
uses: actions/checkout@v1

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build Storybook
run: yarn build:storybook

- name: Deploy production to Netlify
uses: South-Paw/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
build-dir: './storybook-static'

1 comment on commit 01afcb1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Netlify deployed react-obfuscate-ts as draft

https://5f464cb826effbdbf2358aba--react-obfuscate-ts.netlify.app

Please sign in to comment.