Skip to content

Commit

Permalink
Move to Github Actions for Release CI, publish to Dockerhub and GHCR (#…
Browse files Browse the repository at this point in the history
…76)

* Release to dockerhub and ghcr using only github actions
* Update with Rancher Vault auth

Signed-off-by: Derek Nola <derek.nola@suse.com>
  • Loading branch information
dereknola authored Mar 6, 2025
1 parent b66f14c commit 1dd20bd
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 174 deletions.
174 changes: 0 additions & 174 deletions .drone.yml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: release

on:
release:
types:
- created

jobs:
release:
runs-on: ubuntu-22.04

permissions:
contents: read
packages: write
id-token: write # needed for the Vault authentication

steps:
- name: "Read Vault secrets"
if: github.repository_owner == 'k3s-io'
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_TOKEN ;
- name: Login to DockerHub with Rancher Secrets
if: github.repository_owner == 'k3s-io'
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_TOKEN }}

- name: Login to DockerHub with GHA Secrets
if: github.repository_owner != 'k3s-io'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push (k3s-io)
if: github.repository_owner == 'k3s-io'
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ env.DOCKER_USERNAME }}/klipper-lb:latest
${{ env.DOCKER_USERNAME }}/klipper-lb:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/klipper-lb:latest
ghcr.io/${{ github.repository_owner }}/klipper-lb:${{ github.ref_name }}
- name: Build and push (forks)
if: github.repository_owner != 'k3s-io'
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/klipper-lb:latest
${{ secrets.DOCKER_USERNAME }}/klipper-lb:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/klipper-lb:latest
ghcr.io/${{ github.repository_owner }}/klipper-lb:${{ github.ref_name }}

0 comments on commit 1dd20bd

Please sign in to comment.