Skip to content

Commit

Permalink
ci: migrate .drone.yml to github build action
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Serong <[email protected]>
  • Loading branch information
tserong committed Apr 10, 2024
1 parent 1eb5122 commit 5b95b78
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: build and publish
on:
push:
branches:
- master
- v*
env:
# Hopefully fake up DRONE_BRANCH so it's picked up when
# dapper gets to scripts/version...
DRONE_BRANCH: ${{ github.ref_name }}
jobs:
build:
name: Build and Publish
runs-on:
- self-hosted
- Linux
- kvm
- vagrant
- equinix
- X64
container:
image: rancher/dapper:v0.5.8
steps:
# Git is not in Dapper container image. Add it manually for dirty check.
- name: Add Git
run: apk add -U git

- name: Checkout code
uses: actions/checkout@v4

- name: Run dapper ci
run: dapper ci

# These next two items, should, I hope, be a reasonable translation of
# .drone.yml's publish-head step.
- name: GCS Auth
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.google_auth_key }}'

- name: Publish Head
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
predefinedAcl: publicRead
headers: |-
cache-control: public,no-cache,proxy-revalidate
path: dist/artifacts
destination: releases.rancher.com/harvester/${{ github.ref_name }}
parent: false

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_password }}

- name: Docker Publish Cluster Repo
uses: docker/build-push-action@v5
with:
context: dist/harvester-cluster-repo
file: dist/harvester-cluster-repo/Dockerfile
push: true
tags: rancher/harvester-cluster-repo:${{ github.ref_name }}-head-amd64

0 comments on commit 5b95b78

Please sign in to comment.