-
Notifications
You must be signed in to change notification settings - Fork 8
53 lines (51 loc) · 1.7 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
name: Release
on:
push:
tags:
- '*'
permissions:
contents: write
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set lower case repo name
run: |
echo "REPOSITORY_NAME_LOWER=${REPOSITORY_NAME,,}" >>${GITHUB_ENV}
env:
REPOSITORY_NAME: '${{ github.repository }}'
- name: Login GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and push the container image
run: |
make docker-buildx IMG=ghcr.io/${{ env.REPOSITORY_NAME_LOWER }}:${{ github.ref_name }} PLATFORMS=linux/amd64,linux/arm64
- name: Build deployment YAML file
run: |
cd config/manager && kustomize edit set image controller=ghcr.io/${{ env.REPOSITORY_NAME_LOWER }}:${{ github.ref_name }}
cd -
kustomize build config/default > carbonawarekedascaler-${{ github.ref_name }}.yaml
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload deployment YAML file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./carbonawarekedascaler-${{ github.ref_name }}.yaml
asset_name: carbonawarekedascaler-${{ github.ref_name }}.yaml
asset_content_type: application/x-yaml