-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: move from drone ci to github action
Signed-off-by: Chris Chiu <[email protected]>
- Loading branch information
1 parent
e03983a
commit 033d316
Showing
11 changed files
with
175 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Main Build and Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-main: | ||
uses: ./.github/workflows/template-build.yml | ||
with: | ||
release-tag-name: ${{ github.ref_name }}-head | ||
push: true | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Pull Request Build | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build-pr: | ||
uses: ./.github/workflows/template-build.yml | ||
with: | ||
release-tag-name: pull-${{ github.event.number }} | ||
push: false | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Tag Build and Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- v** | ||
|
||
jobs: | ||
build-tag: | ||
uses: ./.github/workflows/template-build.yml | ||
with: | ||
release-tag-name: ${{ github.ref_name }} | ||
push: true | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
release-tag-name: | ||
required: true | ||
type: string | ||
push: | ||
required: true | ||
type: boolean | ||
|
||
env: | ||
repo: "rancher" | ||
controllerImageName: "harvester-network-controller" | ||
helperImageName: "harvester-network-helper" | ||
webhookImageName: "harvester-network-webhook" | ||
|
||
jobs: | ||
dapper-build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Run dapper | ||
run: make ci | ||
|
||
- name: Read some Secrets | ||
uses: rancher-eio/read-vault-secrets@main | ||
if: ${{ inputs.push == true }} | ||
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_PASSWORD | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
if: ${{ inputs.push == true }} | ||
with: | ||
username: ${{ env.DOCKER_USERNAME }} | ||
password: ${{ env.DOCKER_PASSWORD }} | ||
|
||
- name: Docker Build (Controller) | ||
uses: docker/build-push-action@v5 | ||
with: | ||
provenance: false | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: package/Dockerfile | ||
push: ${{ inputs.push }} | ||
tags: ${{ env.repo }}/${{ env.controllerImageName }}:${{ inputs.release-tag-name }} | ||
|
||
- name: Docker Build (Helper) | ||
uses: docker/build-push-action@v5 | ||
with: | ||
provenance: false | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: package/Dockerfile.helper | ||
push: ${{ inputs.push }} | ||
tags: ${{ env.repo }}/${{ env.helperImageName }}:${{ inputs.release-tag-name }} | ||
|
||
- name: Docker Build (Webhook) | ||
uses: docker/build-push-action@v5 | ||
with: | ||
provenance: false | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: package/Dockerfile.webhook | ||
push: ${{ inputs.push }} | ||
tags: ${{ env.repo }}/${{ env.webhookImageName }}:${{ inputs.release-tag-name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
# syntax=docker/dockerfile:1.7.0 | ||
|
||
FROM registry.suse.com/bci/bci-base:15.5 | ||
RUN zypper -n rm container-suseconnect && \ | ||
zypper install -y iptables=1.8.7 && \ | ||
zypper -n clean -a && rm -rf /tmp/* /var/tmp/* /usr/share/doc/packages/* | ||
COPY bin/harvester-network-controller /usr/bin/ | ||
|
||
ARG TARGETPLATFORM | ||
|
||
RUN if [ "$TARGETPLATFORM" != "linux/amd64" ] && [ "$TARGETPLATFORM" != "linux/arm64" ]; then \ | ||
echo "Error: Unsupported TARGETPLATFORM: $TARGETPLATFORM" && \ | ||
exit 1; \ | ||
fi | ||
|
||
ENV ARCH=${TARGETPLATFORM#linux/} | ||
|
||
COPY bin/harvester-network-controller-${ARCH} /usr/bin/harvester-network-controller | ||
CMD ["harvester-network-controller"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
# syntax=docker/dockerfile:1.7.0 | ||
|
||
FROM registry.suse.com/bci/bci-minimal:15.5 | ||
COPY bin/harvester-network-helper /usr/bin/ | ||
|
||
ARG TARGETPLATFORM | ||
|
||
RUN if [ "$TARGETPLATFORM" != "linux/amd64" ] && [ "$TARGETPLATFORM" != "linux/arm64" ]; then \ | ||
echo "Error: Unsupported TARGETPLATFORM: $TARGETPLATFORM" && \ | ||
exit 1; \ | ||
fi | ||
|
||
ENV ARCH=${TARGETPLATFORM#linux/} | ||
|
||
COPY bin/harvester-network-helper-${ARCH} /usr/bin/harvester-network-helper | ||
CMD ["harvester-network-helper"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
# syntax=docker/dockerfile:1.7.0 | ||
|
||
FROM registry.suse.com/bci/bci-minimal:15.5 | ||
COPY bin/harvester-network-webhook /usr/bin/ | ||
|
||
ARG TARGETPLATFORM | ||
|
||
RUN if [ "$TARGETPLATFORM" != "linux/amd64" ] && [ "$TARGETPLATFORM" != "linux/arm64" ]; then \ | ||
echo "Error: Unsupported TARGETPLATFORM: $TARGETPLATFORM" && \ | ||
exit 1; \ | ||
fi | ||
|
||
ENV ARCH=${TARGETPLATFORM#linux/} | ||
|
||
COPY bin/harvester-network-webhook-${ARCH} /usr/bin/harvester-network-webhook | ||
CMD ["harvester-network-webhook"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters