-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add github actions * upload artifacts * Update Makefile Co-authored-by: Andriy Knysh <[email protected]> Co-authored-by: Andriy Knysh <[email protected]>
- Loading branch information
Showing
8 changed files
with
96 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: "docker" | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout source code at current commit" | ||
uses: actions/checkout@v2 | ||
- name: "Build and push docker image to DockerHub" | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
repository: ${{ github.repository }} | ||
registry: registry-1.docker.io | ||
tag_with_ref: true | ||
tag_with_sha: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: 'go' | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checkout the repo | ||
- name: 'Checkout' | ||
uses: actions/checkout@v2 | ||
# Build Go binaries | ||
- name: 'Build Go binaries' | ||
uses: cloudposse/actions/go/[email protected] | ||
env: | ||
GO111MODULE: on | ||
# Architectures to build for | ||
GOX_OSARCH: >- | ||
windows/386 | ||
windows/amd64 | ||
freebsd/arm | ||
netbsd/386 | ||
netbsd/amd64 | ||
netbsd/arm | ||
linux/s390x | ||
linux/arm | ||
darwin/386 | ||
darwin/amd64 | ||
linux/386 | ||
linux/amd64 | ||
freebsd/amd64 | ||
freebsd/386 | ||
openbsd/386 | ||
openbsd/amd64 | ||
OUTPUT_PATH: ${{ github.workspace }}/release/${{ github.event.repository.name }}_ | ||
# Upload artifacts for this build | ||
- name: 'Upload artifacts' | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
path: ${{ github.workspace }}/release/* | ||
# Attach Go binaries to GitHub Release | ||
- name: 'Attach artifacts to GitHub Release' | ||
if: ${{ github.event_name == 'release' }} | ||
uses: cloudposse/actions/github/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
INPUT_PATH: ${{ github.workspace }}/release/${{ github.event.repository.name }}_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
FROM golang:1.9.3 as builder | ||
RUN mkdir -p /go/src/github.com/cloudposse/slack-notifier | ||
WORKDIR /go/src/github.com/cloudposse/slack-notifier | ||
COPY . . | ||
RUN go get && CGO_ENABLED=0 go build -v -o "./dist/bin/slack-notifier" *.go | ||
FROM golang:1.13.3-buster as builder | ||
ENV GO111MODULE=on | ||
ENV CGO_ENABLED=0 | ||
WORKDIR /usr/src/ | ||
COPY . /usr/src | ||
RUN go build -v -o "bin/slack-notifier" *.go | ||
|
||
|
||
FROM alpine:3.6 | ||
FROM alpine:3.12 | ||
RUN apk add --no-cache ca-certificates | ||
COPY --from=builder /go/src/github.com/cloudposse/slack-notifier/dist/bin/slack-notifier /usr/bin/slack-notifier | ||
COPY --from=builder /usr/src/bin/* /usr/bin/ | ||
ENV PATH $PATH:/usr/bin | ||
ENTRYPOINT ["slack-notifier"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
SHELL = /bin/bash | ||
|
||
PATH:=$(PATH):$(GOPATH)/bin | ||
export DOCKER_ORG ?= cloudposse | ||
export DOCKER_IMAGE ?= $(DOCKER_ORG)/slack-notifier | ||
export DOCKER_TAG ?= latest | ||
export DOCKER_IMAGE_NAME ?= $(DOCKER_IMAGE):$(DOCKER_TAG) | ||
export DOCKER_BUILD_FLAGS = | ||
|
||
include $(shell curl --silent -o .build-harness "https://raw.githubusercontent.com/cloudposse/build-harness/master/templates/Makefile.build-harness"; echo .build-harness) | ||
|
||
|
||
.PHONY : go-get | ||
go-get: | ||
go get | ||
|
||
|
||
.PHONY : go-build | ||
go-build: go-get | ||
CGO_ENABLED=0 go build -v -o "./dist/bin/slack-notifier" *.go | ||
-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/cloudposse/slack-notifier | ||
|
||
go 1.13 |