deploy to heroku with docker and github action

This commit is contained in:
2019-09-11 11:54:11 -04:00
parent 4fbcdbe2a6
commit 016242bcf3
5 changed files with 232 additions and 212 deletions
+44
View File
@@ -0,0 +1,44 @@
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Lint
uses: actions-contrib/golangci-lint@master
with:
args: run
- name: Setup Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Get dependencies
run: go mod download
- name: Build
run: go build -v .
- name: Heroku Login
uses: actions/heroku@master
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
args: container:login
- name: Heroku Push
uses: actions/heroku@master
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
args: container:push -a npqueue web
- name: Heroku Release
uses: actions/heroku@master
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
with:
args: container:release -a npqueue web
-40
View File
@@ -1,40 +0,0 @@
name: Go
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.12
uses: actions/setup-go@v1
with:
go-version: 1.12
id: go
- name: Check out code
uses: actions/checkout@v1
- name: Download and install golangci-lint
run: |
curl -L https://github.com/golangci/golangci-lint/releases/download/v1.17.1/golangci-lint-1.17.1-linux-amd64.tar.gz | tar xzf - -C /tmp
sudo mv /tmp/golangci-lint-1.17.1-linux-amd64/golangci-lint /usr/local/bin/golangci-lint
- name: Run the linter
run: golangci-lint run
- name: Install deps
run: go mod download
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: go build -v .