Skip to content

Instantly share code, notes, and snippets.

@msurguy
Created September 25, 2019 23:00
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 msurguy/20f7662140d94fc5e7ea7bc1730c0623 to your computer and use it in GitHub Desktop.
Save msurguy/20f7662140d94fc5e7ea7bc1730c0623 to your computer and use it in GitHub Desktop.
Github actions
// Slack action:
https://github.com/Ilshidur/action-slack
args = "tag v*"
tags:
- v1 # Push events to v1 tag
- v1.0 # Push events to v1.0 tag
on:
push:
branches:
- releases/*
on:
push:
tags:
- 'v*'
- '!v*.*.*-*.*'
branches:
- 'refs/tags/*'
- '!refs/heads/*'
try with create instead of push
name: release
on:
push:
branches:
- master
tags:
- v*
on:
release:
types: [published]
GITHUB_REF
jobs:
tests:
name: run tests and build release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: run tests
uses: docker://golang:latest
with:
entrypoint: go
args: test -race -coverprofile=coverage.txt -covermode=atomic
- name: send coverage to codecov
uses: Atrox/codecov-action@v0.1.3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: goreleaser
uses: docker://goreleaser/goreleaser
env:
GORELEASER_GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
with:
args: release
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Check source code
run: |
yarn lint
yarn prettier:check
yarn copy:paste:detector
- name: Compile source code
run: yarn compile
- name: Run tests
run: |
yarn test:unit:coverage
yarn test:integration
- name: Production deploy to ZEIT Now
if: github.ref == 'refs/heads/master'
run: yarn now -t $NOW_TOKEN -e GITLAB_SECRET_TOKEN -e IFTTT_BASE_URL -e IFTTT_KEY -e MONGO_URI -e SENTRY_DSN --prod
env:
NOW_TOKEN: ${{ secrets.NOW_TOKEN }}
GITLAB_SECRET_TOKEN: ${{ secrets.GITLAB_SECRET_TOKEN }}
IFTTT_BASE_URL: ${{ secrets.IFTTT_BASE_URL }}
IFTTT_KEY: ${{ secrets.IFTTT_KEY }}
MONGO_URI: ${{ secrets.MONGO_URI }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
# Slack action args
args = "A new issue has been added. \\nURL - {{ EVENT_PAYLOAD.issue.html_url }} \\nTitle - {{ EVENT_PAYLOAD.issue.title }} \\nBody - {{ EVENT_PAYLOAD.issue.body }}"
# https://github.com/8398a7/action-slack/blob/master/.github/workflows/checkin.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment