Skip to content

Commit

Permalink
Merge pull request #54 from homoluctus/feature/update_deploy_flow
Browse files Browse the repository at this point in the history
Update deployment flow
  • Loading branch information
homoluctus authored Nov 12, 2019
2 parents e844f88 + 473ba82 commit dcef5f1
Show file tree
Hide file tree
Showing 15 changed files with 14,779 additions and 5,520 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/deploy.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/develop.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: TS Lint Check
on:
pull_request:
branches:
- develop
- releases/*
- master
paths:
- src/*

Expand Down
77 changes: 13 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,86 +2,35 @@ name: Prepare for release

on:
push:
branches:
- releases/*

paths:
- src/*
tags:
- 'v*'

jobs:
release:
name: Build production
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
with:
ref: remotes/origin/releases/v1

- name: Git checkout
run: git checkout -b releases/v1

- name: Setup Node
uses: actions/setup-node@v1
- uses: actions/setup-node@v1
with:
node-version: '10.x'

- name: Install dependencies
run: npm install

- name: NPM build
run: npm run build

- name: Not ignore node_modules
run: sed -i '/node_modules*/d' .gitignore

- name: Install dependencies for production
run: |
rm -rf node_modules
npm install --production
- name: Setup git
- name: Create Release
uses: actions/[email protected]
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
git config --local user.name homoluctus
git config --local user.email [email protected]
git remote set-url origin https://homoluctus:${ACCESS_TOKEN}@github.com/homoluctus/slatify.git
- name: Git commit
run: |
git add -A
DIFF=`git diff --cached --numstat | wc -l`
if [ $DIFF -eq 0 ]; then
exit 0
fi
git commit -am '[UPDATE] prepare for release'
- name: Git push
run: git push origin HEAD

- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
type: ${{ job.status }}
job_name: ':truck: *Prepare for release*'
channel: '#develop'
url: ${{ secrets.SLACK_WEBHOOK }}

check:
name: Check action
runs-on: ubuntu-18.04
needs: release
steps:
- uses: actions/checkout@master
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: 'false'
prerelease: 'false'

- name: Slack Notification
uses: homoluctus/slatify@releases/v1
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: ':robot_face: *Check action*'
job_name: ':rocket: *Publish new release ${{ github.ref }}*'
channel: '#develop'
url: ${{ secrets.SLACK_WEBHOOK }}
url: ${{ secrets.SLACK_WEBHOOK }}
13 changes: 5 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Check notification

on:
pull_request:
branches:
- master
on: pull_request

jobs:
success:
Expand All @@ -13,7 +10,7 @@ jobs:
- uses: actions/checkout@master

- name: Slack Notification
uses: homoluctus/slatify@releases/v1
uses: ./
if: always()
with:
type: ${{ job.status }}
Expand All @@ -30,7 +27,7 @@ jobs:
- uses: actions/checkout@master

- name: Slack Notification
uses: homoluctus/slatify@releases/v1
uses: ./
if: always()
with:
type: ${{ job.status }}
Expand All @@ -48,7 +45,7 @@ jobs:
run: exit 1

- name: Slack Notification
uses: homoluctus/slatify@releases/v1
uses: ./
if: always()
with:
type: ${{ job.status }}
Expand All @@ -70,7 +67,7 @@ jobs:
run: sleep 60

- name: Slack Notification
uses: homoluctus/slatify@releases/v1
uses: ./
if: always()
with:
type: ${{ job.status }}
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You can customize the following parameters:

|with parameter|required/optional|default|description|
|:--:|:--:|:--|:--|
|type|required|N/A|The result of GitHub Actions job<br>This parameter value must contain the following word:<br>- `success`<br>- `fail`<br>- `cancel`<br>We recommend using ${{ job.status }}|
|type|required|N/A|The result of GitHub Actions job<br>This parameter value must contain the following word:<br>- `success`<br>- `failure`<br>- `cancelled`<br>We recommend using ${{ job.status }}|
|job_name|required|N/A|Means slack notification title|
|url|required|N/A|Slack Incoming Webhooks URL<br>Please specify this key or SLACK_WEBHOOK environment variable<br>※SLACK_WEBHOOK will be deprecated|
|mention|optional|N/A|Slack message mention|
Expand Down Expand Up @@ -53,16 +53,12 @@ Please refer `action.yml` for more details.

<img src="./images/slack.png" alt="Notification Preview" width="70%">

## Preview

<img src="./images/preview.png" alt="Notification Preview" width="70%">

# Contribute
1. Fork this repository
2. Pull your repository in local machine
3. Update original repository
4. Checkout "develop" branch based "remotes/origin/develop" branch
5. Work on "develop" branch
4. Checkout "master" branch based "remotes/origin/master" branch
5. Work on "master" branch
6. Push you changes to your repository
7. Create a new Pull Request

Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'Slack Notification for Github Actions'
author: 'homoluctus'
inputs:
type:
description: 'job status (success or failure)'
description: 'job status (success, failure or cancelled)'
required: true
job_name:
description: 'job name of workflow (format: markdown)'
Expand All @@ -12,7 +12,7 @@ inputs:
description: 'slack mention'
required: false
mention_if:
description: 'the condition to mention'
description: 'the condition for mention'
required: false
username:
description: 'slack username'
Expand All @@ -28,7 +28,7 @@ inputs:
required: false
runs:
using: 'node12'
main: 'lib/main.js'
main: 'dist/index.js'
branding:
icon: 'bell'
color: 'green'
Loading

0 comments on commit dcef5f1

Please sign in to comment.