Skip to content

Commit

Permalink
Build a binary on release
Browse files Browse the repository at this point in the history
  • Loading branch information
charlieegan3 committed Apr 10, 2021
1 parent f9eeef0 commit 31c7a6d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 36 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build-binary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Binary

on:
release:
types:
- published
workflow_dispatch:
inputs: {}

jobs:
refresh:
name: build-binary
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build
run: make binary

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: music
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/image.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
account.json
config.yaml
music
18 changes: 2 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
TAG=$(shell git rev-parse HEAD)

ifndef DOCKER_USERNAME
$(error DOCKER_USERNAME is not set)
endif
ifndef DOCKER_PASSWORD
$(error DOCKER_PASSWORD is not set)
endif

docker-login:
docker login -u $(DOCKER_USERNAME) -p $(DOCKER_PASSWORD)

image: docker-login
docker build . -t charlieegan3/music:$(TAG) -t charlieegan3/music:latest
docker push charlieegan3/music:$(TAG)
docker push charlieegan3/music:latest
binary:
go build

0 comments on commit 31c7a6d

Please sign in to comment.