-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #455 from rancher/gha
Migration to GHA
- Loading branch information
Showing
17 changed files
with
415 additions
and
353 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,87 @@ | ||
name: Backup Restore CI | ||
|
||
permissions: | ||
contents : read | ||
|
||
on: | ||
push: | ||
branches: | ||
- release/v5.0 | ||
- release/v4.0 | ||
- release/v3.0 | ||
paths-ignore: | ||
- 'docs/**' | ||
- '*.md' | ||
- '.gitignore' | ||
- 'CODEOWNERS' | ||
- 'LICENSE' | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- '*.md' | ||
- '.gitignore' | ||
- 'CODEOWNERS' | ||
- 'LICENSE' | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os : [ | ||
ubuntu-latest | ||
# org-rancher-arm64-containers | ||
] | ||
name : CI | ||
runs-on : ${{ matrix.os }} | ||
outputs: | ||
k3sversions: ${{ steps.support.outputs.k3sversions }} | ||
steps: | ||
- name : Checkout repository | ||
uses : actions/checkout@v4 | ||
with : | ||
fetch-depth : 0 | ||
- name: Set K3s support output | ||
id : support | ||
run: ./.github/workflows/scripts/supported-versions.sh | awk '{print "k3sversions="$0}' >> $GITHUB_OUTPUT | ||
- name : CI | ||
run : make ci | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bro-build-artifacts-${{ matrix.os }} | ||
path: ./dist/artifacts | ||
|
||
test: | ||
name : integration-test | ||
needs : [ | ||
build | ||
] | ||
runs-on : ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os : [ | ||
ubuntu-latest | ||
# org-rancher-arm64-containers, | ||
] | ||
K3S_VERSION : ${{ fromJSON(needs.build.outputs.k3sversions) }} | ||
steps: | ||
- name : Checkout repository | ||
uses : actions/checkout@v4 | ||
- name : Fetch build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bro-build-artifacts-${{ matrix.os }} | ||
path: ./dist/artifacts/ | ||
- name : Debug | ||
run : ls -R ./dist/artifacts | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name : Load backup-restore-operator image | ||
run : docker image load -i ./dist/artifacts/backup-restore-operator.img | ||
- name : Setup up K3d | ||
run : ./.github/workflows/scripts/install-k3d.sh | ||
- name : Setup up mc | ||
run : ./.github/workflows/scripts/install-mc.sh | ||
- name : Setup k3d cluster | ||
run : CLUSTER_NAME=backup-restore K3S_VERSION=${{ matrix.K3S_VERSION }} ./.github/workflows/scripts/setup-cluster.sh | ||
- name : Run integration tests | ||
run : ./scripts/integration |
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,52 @@ | ||
name : Publish Images | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
env: | ||
REGISTRY: docker.io | ||
REPO : rancher | ||
|
||
|
||
jobs: | ||
ci : | ||
uses: rancher/backup-restore/.github/workflows/ci.yaml@release/v5.0 | ||
permissions: | ||
contents: read | ||
push: | ||
permissions: | ||
contents : read | ||
id-token: write | ||
name : Build and push BRO images | ||
runs-on : ubuntu-latest | ||
steps: | ||
- name : "Read vault secrets" | ||
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_PASSWORD | ||
- name : Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.DOCKER_USERNAME }} | ||
password: ${{ env.DOCKER_PASSWORD }} | ||
# setup tag name | ||
- if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
run: | | ||
echo TAG_NAME=$(echo $GITHUB_REF | sed -e "s|refs/tags/||") >> $GITHUB_ENV | ||
- name: Build and push BRO image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./package/Dockerfile | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.REPO }}/backup-restore-operator:${{ env.TAG_NAME }} | ||
platforms: linux/amd64,linux/arm64 |
Oops, something went wrong.