-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.67 KB
/
push_tag.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
name: Push Tag
on:
release:
types:
- published
permissions:
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "^1.22.5"
- name: Build Manager
run: |
make manager
- name: Build Docker Image
env:
DOCKER_USERNAME: ${{ github.repository_owner }}
TAG: ${{ github.event.release.tag_name }}
run: |
make DOCKER_REPO=ghcr.io/$DOCKER_USERNAME DOCKER_IMAGE_TAG=$TAG docker
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Publish Docker Image
env:
DOCKER_USERNAME: ${{ github.repository_owner }}
TAG: ${{ github.event.release.tag_name }}
run: |
make DOCKER_REPO=ghcr.io/$DOCKER_USERNAME DOCKER_IMAGE_TAG=$TAG docker-push
- name: Package Helm and Generate Manifests
env:
TAG: ${{ github.event.release.tag_name }}
run: |
make helm-crds
helm package --app-version=$TAG --version=$TAG deploy/charts/hostport-allocator -d ./bin/
cp deploy/manifests/01-namespace.yaml bin/hostport-allocator.yaml
helm template ./bin/hostport-allocator-$TAG.tgz -f deploy/manifests/helm-values.yaml --namespace hostport-allocator >> bin/hostport-allocator.yaml
- name: Upload Manifests
uses: softprops/action-gh-release@v2
with:
files: ./bin/hostport-allocator.yaml