This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
62 lines (52 loc) · 1.92 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- v*
jobs:
build:
name: Build and Deploy
runs-on: ubuntu-latest
env:
BUILD_METADATA: build.${{ github.run_number }}
GIT_COMMIT: ${{ github.sha }}
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: '${{ github.actor }}'
password: '${{ github.token }}'
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: '${{ secrets.DOCKERHUB_USERNAME }}'
password: '${{ secrets.DOCKERHUB_TOKEN }}'
- name: Build and push controller
run: |
export VERSION="${GITHUB_REF_NAME}"
export IMG="thestormforge/optimize-controller:${GITHUB_REF_NAME#v}"
export SETUPTOOLS_IMG="thestormforge/setuptools:${GITHUB_REF_NAME#v}"
export PULL_POLICY=""
make -o test docker-build
make docker-push
skopeo copy "docker://${IMG}" "docker://${IMG%%:*}:latest"
skopeo copy "docker://${IMG}" "docker://ghcr.io/${IMG}"
skopeo copy "docker://${IMG}" "docker://ghcr.io/${IMG%%:*}:latest"
skopeo copy "docker://${SETUPTOOLS_IMG}" "docker://${SETUPTOOLS_IMG%%:*}:latest"
skopeo copy "docker://${SETUPTOOLS_IMG}" "docker://ghcr.io/${SETUPTOOLS_IMG}"
skopeo copy "docker://${SETUPTOOLS_IMG}" "docker://ghcr.io/${SETUPTOOLS_IMG%%:*}:latest"
- name: Update Helm Chart
env:
GH_TOKEN: ${{ secrets.BMASTERS_TOKEN }}
GH_REPO: thestormforge/helm-charts
run: gh workflow run build.yaml --ref main -f image_tag=${GITHUB_REF_NAME#v}
- name: Draft release
run: gh release create "${GITHUB_REF_NAME}" --draft --notes-file ./.github/RELEASE_TEMPLATE.md