-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added dockerfile and docker-compose, added github action
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 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,39 @@ | ||
name: push | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
env: | ||
DOCKER_REPO: codex-team/opencollective-webhook | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker://golangci/golangci-lint:v1.41.1 | ||
with: | ||
args: golangci-lint run | ||
|
||
build: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push production image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: ${{ endsWith(github.ref, 'refs/tags/v') }} | ||
tags: ${{ steps.meta.outputs.tags }} |
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,22 @@ | ||
FROM golang:1.16-alpine as build | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod ./ | ||
COPY go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY *.go ./ | ||
|
||
RUN go build -o /opencollective-webhook | ||
|
||
FROM alpine:3.14.1 | ||
|
||
WORKDIR / | ||
|
||
COPY --from=build /opencollective-webhook /opencollective-webhook | ||
|
||
COPY .env ./ | ||
|
||
ENTRYPOINT ["/opencollective-webhook"] |
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,8 @@ | ||
version: "3.8" | ||
|
||
services: | ||
app: | ||
build: | ||
dockerfile: ./Dockerfile | ||
context: . | ||
restart: on-failure |