Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
ci: Migrating to Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
ViBiOh committed Nov 3, 2020
1 parent 2ebfc2f commit 7bddfee
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 39 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: Build

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
SCRIPTS_NO_INTERACTIVE: "true"

defaults:
run:
shell: bash

jobs:
build:
name: Golang
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "^1.15"
- run: |
make
git --no-pager diff -- ':(exclude)go.sum' && git diff --quiet -- ':(exclude)go.sum'
docker build "APP_VERSION=$(make version)" -t "${{ secrets.DOCKER_USER }}/$(make name):$(make version)" .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- run: |
docker push "${{ secrets.DOCKER_USER }}/$(make name):$(make version)"
- uses: codecov/codecov-action@v1

publish:
name: Publish
runs-on: ubuntu-latest
needs: package
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v2
- name: Publish
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
run: |
curl -q -sSL --max-time 30 "https://raw.githubusercontent.com/ViBiOh/scripts/master/bootstrap" | bash -s "docker_promote"
scripts/docker_promote "${{ secrets.DOCKER_USER }}/$(make name)" "$(make version)"
- name: GoReport
run: |
curl -q -sSL --max-time 30 -X POST https://goreportcard.com/checks?repo=github.com/${GITHUB_REPOSITORY}
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

12 changes: 0 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
FROM golang:1.15 as builder

WORKDIR /app
COPY . .

RUN make \
&& git diff -- *.go \
&& git diff --quiet -- *.go

ARG CODECOV_TOKEN
RUN curl -q -sSL --max-time 30 https://codecov.io/bash | bash

FROM docker/compose:1.27.4

EXPOSE 1080
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# deploy

[![Build Status](https://travis-ci.com/ViBiOh/deploy.svg?branch=master)](https://travis-ci.com/ViBiOh/deploy)
[![Build](https://github.com/ViBiOh/deploy/workflows/Build/badge.svg)](https://github.com/ViBiOh/deploy/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/ViBiOh/deploy)](https://goreportcard.com/report/github.com/ViBiOh/deploy)
[![codecov](https://codecov.io/gh/ViBiOh/deploy/branch/master/graph/badge.svg)](https://codecov.io/gh/ViBiOh/deploy)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgit.luolix.top%2FViBiOh%2Fdeploy.svg?type=shield)](https://app.fossa.io/projects/git%2Bgit.luolix.top%2FViBiOh%2Fdeploy?ref=badge_shield)
Expand Down

0 comments on commit 7bddfee

Please sign in to comment.