-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (71 loc) · 2.61 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Release
on:
push:
tags:
- "*"
# TODO: only main branch
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Generate Release Notes
id: changelog
uses: ./.github/changelog
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Run GoReleaser
uses: goreleaser/[email protected]
with:
version: latest
args: release --rm-dist --release-notes=${{ steps.changelog.outputs.filepath }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
- name: Release Deployment YAML file
run: make release
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
# Get release information to determine id of the current release
- name: Get Release
id: get-release-info
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload deployment YAML file to GitHub release
- name: Upload Deployment YAML file
id: upload-deployment-yaml
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/relativitydev/containership/releases/${{ steps.get-release-info.outputs.id }}/assets?name=containership-${{ steps.get_version.outputs.VERSION }}.yaml
asset_path: containership-${{ steps.get_version.outputs.VERSION }}.yaml
asset_name: containership-${{ steps.get_version.outputs.VERSION }}.yaml
asset_content_type: application/x-yaml
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
tags: relativitydev/containership:latest,relativitydev/containership:${{ steps.previoustag.outputs.tag }}