-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.3 KB
/
semantic-release-build.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
name: Release and build
on:
push:
branches:
- master
jobs:
semantic-release:
runs-on: ubuntu-20.04
steps:
- name: check out code
uses: actions/checkout@v2
- name: set up golang
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: create new semantic version
uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
changelog-generator-opt: "emojis=true"
- name: set up docker buildx
uses: docker/setup-buildx-action@v1
- name: cache docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: login to dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: dictybase/static-server:${{ steps.semrel.outputs.version }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache