-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.22 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: release
on:
push:
tags:
- '*'
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go
- name: Check out code
uses: actions/checkout@v2
- name: Test code
run: go test -v ./...
- name: Set some variables
id: vars
run: |
echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/*/})
echo ::set-output name=image::mtharrison/github-pr-comment-resource
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build the tagged Docker image
run: docker build . -t ${{steps.vars.outputs.image}}:${{steps.vars.outputs.tag}}
- name: Push the tagged Docker image
run: docker push ${{steps.vars.outputs.image}}:${{steps.vars.outputs.tag}}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false