Skip to content

Commit

Permalink
Merge pull request #805 from yiannistri/ghcr-nightly
Browse files Browse the repository at this point in the history
ci: Push nightly charts and images to ghcr.io
  • Loading branch information
yiannistri authored Jan 16, 2025
2 parents 9800687 + e5afb9c commit 5997b50
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/nightly-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,58 @@ jobs:
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@v4
- name: Login to GHCR registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.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@v4
- name: Login to GHCR registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install Helm
uses: azure/setup-helm@v4
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

0 comments on commit 5997b50

Please sign in to comment.