Skip to content

Nightly

Nightly #1121

name: Nightly
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
publish_nightly:
uses: rancher-sandbox/hosted-providers-reusable-workflows/.github/workflows/operator-with-latest-rancher-build.yaml@a8c5ab146fed1a6ba07b5947d045fa05593b8173 # main
with:
operator_name: gke-operator
operator_commit: ${{ github.sha }}
publish_images:
permissions:
packages: write # Required for pushing images to ghcr.io
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Login to GHCR registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Set image tag
run: echo "TAG=v0.0.0-$(date +'%Y%m%d')" >> "$GITHUB_ENV"
- name: Build and push image
env:
REPO: ghcr.io/rancher
run: |
make image-push
publish_charts:
permissions:
packages: write # Required for pushing charts to ghcr.io
runs-on: ubuntu-latest
needs: publish_images
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Login to GHCR registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: 3.8.0
- name: Set image tag and chart version
run: |
echo "TAG=v0.0.0-$(date +'%Y%m%d')" >> "$GITHUB_ENV"
echo "CHART_VERSION=$(date +'%Y%m%d')" >> "$GITHUB_ENV"
- name: Build charts
env:
REPO: ghcr.io/rancher # used in the Helm chart values.yaml
run: |
make charts
- name: Push charts
run: |
helm push bin/rancher-gke-operator-$CHART_VERSION.tgz oci://ghcr.io/${{ github.repository_owner }}/rancher-gke-operator-chart
helm push bin/rancher-gke-operator-crd-$CHART_VERSION.tgz oci://ghcr.io/${{ github.repository_owner }}/rancher-gke-operator-crd-chart