Skip to content

Instantly share code, notes, and snippets.

@Tetsuya-Minase
Last active January 31, 2020 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tetsuya-Minase/73d969597939aa96badef2b9e6255c82 to your computer and use it in GitHub Desktop.
Save Tetsuya-Minase/73d969597939aa96badef2b9e6255c82 to your computer and use it in GitHub Desktop.
github actions yml
name: deploy-sample-workflow
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: setup
uses: actions/setup-node@v1
with:
node-version: 12
- name: install and setup config
run: |
npm install
npm run config -- credentials --provider aws --key ${{secrets.SLS_KEY}} --secret ${{secrets.SLS_SEC}}
- name: deploy
run: npm run deploy -- --webhook=${{secrets.SLS_HOOK}}
name: sample-workflow
on:
pull_request:
branches:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: setup
uses: actions/setup-node@v1
with:
node-version: 12
- name: install and setup config
run: npm install
- name: lint
run: npm run lint:format
- name: test
run: npm test
name: slack-sample-workflow
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: setup
uses: actions/setup-node@v1
with:
node-version: 12
- name: install
run: npm install
- name: build
run: npm run generate
- name: deploy
run: npm run deploy:only -- --token=${{secrets.token}}
- name: slack-notice-failure
if: failure()
uses: rtCamp/action-slack-notify@v2.0.0
env:
SLACK_CHANNEL: 'チャンネル名'
SLACK_COLOR: '#3278BD'
SLACK_MESSAGE: 'メッセージ'
SLACK_TITLE: 'タイトル'
SLACK_USERNAME: '名前'
SLACK_WEBHOOK: ${{ secrets.SLACK_TOKEN }}
- name: slack-notice-success
if: success()
uses: rtCamp/action-slack-notify@v2.0.0
env:
SLACK_CHANNEL: 'チャンネル名'
SLACK_COLOR: '#3278BD'
SLACK_MESSAGE: 'メッセージ'
SLACK_TITLE: 'タイトル'
SLACK_USERNAME: '名前'
SLACK_WEBHOOK: ${{ secrets.SLACK_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment