Skip to content

v0.1.11

v0.1.11 #21

Workflow file for this run

name: Push Tag
on:
release:
types:
- published
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "^1.22.2"
- 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@v1
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: Get Release
id: get_release
uses: bruceadams/get-release@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Manifests
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./bin/hostport-allocator.yaml
asset_name: hostport-allocator.yaml
asset_content_type: application/yaml