Skip to content

fix: use ReplicatedImageRegistry noProxy=true for SDK airgap registry #82

fix: use ReplicatedImageRegistry noProxy=true for SDK airgap registry

fix: use ReplicatedImageRegistry noProxy=true for SDK airgap registry #82

Workflow file for this run

name: PR
on:
pull_request:
branches: [main]
permissions:
contents: read
packages: write
jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
version-label: ${{ env.VERSION_LABEL }}
chart-version: ${{ env.CHART_VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set version label
run: |
echo "VERSION_LABEL=pr-${{ github.event.pull_request.number }}-${{ github.run_number }}" >> $GITHUB_ENV
echo "CHART_VERSION=0.0.${{ github.run_number }}" >> $GITHUB_ENV
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64
tags: |
ghcr.io/aa-replicated/gameshelf:pr-${{ github.event.pull_request.number }}
ghcr.io/aa-replicated/gameshelf:pr-${{ github.event.pull_request.number }}-${{ github.run_number }}
- name: Package Helm chart
run: |
helm dependency update chart/gameshelf
helm package chart/gameshelf \
--version ${{ env.CHART_VERSION }} \
--app-version ${{ env.VERSION_LABEL }} \
--destination release/
- name: Copy Replicated configs
run: |
cp .replicated release/
cp embedded-cluster-config.yaml release/
sed "s/chartVersion: .*/chartVersion: \"${{ env.CHART_VERSION }}\"/" helmchart.yaml > release/helmchart.yaml
cp kots-config.yaml release/
cp kots-app.yaml release/
- name: Create Replicated release
id: create-release
uses: replicatedhq/replicated-actions/create-release@v1
with:
app-slug: gameshelf
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
yaml-dir: release/
promote-channel: Unstable
version: ${{ env.CHART_VERSION }}
compatibility-matrix:
needs: build-and-release
runs-on: ubuntu-latest
steps:
- name: Create customer
id: create-customer
uses: replicatedhq/replicated-actions/create-customer@v1
with:
app-slug: gameshelf
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
customer-name: pr-${{ github.event.pull_request.number }}-k3s-1.35
channel-slug: unstable
customer-email: ci-pr-${{ github.event.pull_request.number }}@example.com
expires-in: 1
is-kots-install-enabled: "false"
- name: Create cluster
id: create-cluster
uses: replicatedhq/replicated-actions/create-cluster@v1
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
kubernetes-distribution: k3s
kubernetes-version: "1.35"
cluster-name: gameshelf-pr-${{ github.event.pull_request.number }}
timeout-minutes: 5
ttl: 30m
- name: Deploy chart
uses: replicatedhq/replicated-actions/helm-install@v1
with:
kubeconfig: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
helm-path: helm
registry-username: ci-pr-${{ github.event.pull_request.number }}@example.com
registry-password: ${{ steps.create-customer.outputs.license-id }}
chart: oci://registry.replicated.com/gameshelf/unstable/gameshelf
name: gameshelf
version: ${{ needs.build-and-release.outputs.chart-version }}
namespace: gameshelf
values: |
adminSecret: ci-test-secret
imageProxy:
host: ""
postgresql:
enabled: true
image:
registry: docker.io
volumePermissions:
image:
registry: docker.io
redis:
enabled: true
image:
registry: docker.io
- name: Health check
env:
KUBECONFIG_CONTENT: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
run: |
echo "$KUBECONFIG_CONTENT" > /tmp/kubeconfig.yaml
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=gameshelf \
-n gameshelf --timeout=120s --kubeconfig=/tmp/kubeconfig.yaml
kubectl port-forward svc/gameshelf 8080:80 -n gameshelf \
--kubeconfig=/tmp/kubeconfig.yaml &
sleep 5
curl -f http://localhost:8080/healthz
- name: Remove cluster
if: always()
uses: replicatedhq/replicated-actions/remove-cluster@v1
continue-on-error: true
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
- name: Archive customer
if: always()
uses: replicatedhq/replicated-actions/archive-customer@v1
with:
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
customer-id: ${{ steps.create-customer.outputs.customer-id }}