Skip to content

Merge pull request #482 from furkatgofurov7/move-to-docker-buildx #38

Merge pull request #482 from furkatgofurov7/move-to-docker-buildx

Merge pull request #482 from furkatgofurov7/move-to-docker-buildx #38

Workflow file for this run

name: release
on:
push:
tags:
- "v*.*.*"
env:
TAG: ${{ github.ref_name }}
GHCR_REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
actions: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setupGo
uses: actions/setup-go@v5
with:
go-version: '=1.21.8'
- name: Docker login ghcr.io
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker image to ghcr.io
run: make docker-build-and-push TAG=${{ env.TAG }} REGISTRY=${{ env.GHCR_REGISTRY }}
- name: Read prime registry secrets
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials username | PRIME-REGISTRY-USERNAME;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials password | PRIME-REGISTRY-PASSWORD;
secret/data/github/repo/${{ github.repository }}/rancher-prime-registry/credentials registry | PRIME-REGISTRY-REGISTRY;
- name: Docker login to prime registry
uses: docker/login-action@v3
with:
registry: ${{ env.PRIME-REGISTRY-REGISTRY }}
username: ${{ env.PRIME-REGISTRY-USERNAME }}
password: ${{ env.PRIME-REGISTRY-PASSWORD }}
- name: Build and push docker image to prime registry
run: make docker-build-and-push TAG=${{ env.TAG }} REGISTRY=${{ env.PRIME-REGISTRY-REGISTRY }}
release:
runs-on: ubuntu-latest
permissions:
contents: write
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setupGo
uses: actions/setup-go@v5
with:
go-version: '=1.21.8'
- name: Update manifests
run: |
make release RELEASE_TAG=${{ env.TAG }} REGISTRY=${{ env.GHCR_REGISTRY }}
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ env.TAG }} --draft --generate-notes
gh release upload ${{ env.TAG }} out/metadata.yaml
gh release upload ${{ env.TAG }} out/bootstrap-components.yaml
gh release upload ${{ env.TAG }} out/control-plane-components.yaml