Skip to content

adding support for annotations to be applied from SLV resource to Sec… #54

adding support for annotations to be applied from SLV resource to Sec…

adding support for annotations to be applied from SLV resource to Sec… #54

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
jobs:
release-core:
name: Release CLI & Library
runs-on: ubuntu-latest
steps:
- name: Setting SLV Version
run: echo "SLV_VERSION=${GITHUB_REF_NAME:1}" >> $GITHUB_ENV
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Preparing GoReleaser Builder
run: |
docker build -t goreleaser:local -f .goreleaser/Dockerfile .
- name: GoReleaser - Release SLV
run: |
docker run --rm \
-w /workspace \
-v $PWD:/workspace \
-e GITHUB_TOKEN \
-e HOMEBREW_SSH_KEY \
goreleaser:local release \
-f .goreleaser/slv-core.yaml \
--clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_SSH_KEY: ${{ secrets.HOMEBREW_SSH_KEY }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Release SLV Image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.SLV_VERSION }}
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:latest
release-k8s:
name: Release K8s Operator & Job Images
needs: release-core
runs-on: ubuntu-latest
steps:
- name: Setting SLV Version
run: echo "SLV_VERSION=${GITHUB_REF_NAME:1}" >> $GITHUB_ENV
- name: Checkout Code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
- name: GoReleaser - Release SLV
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: build -f .goreleaser/slv-k8s.yaml --clean
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Release SLV K8s Operator Image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
file: internal/k8s/Dockerfile
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}/slv-k8s-operator:${{ env.SLV_VERSION }}
ghcr.io/${{ github.repository }}/slv-k8s-operator:${{ github.ref_name }}
ghcr.io/${{ github.repository }}/slv-k8s-operator:latest
- name: Release SLV K8s Job Image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
file: internal/k8s/job/Dockerfile
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}/slv-k8s-job:${{ env.SLV_VERSION }}
ghcr.io/${{ github.repository }}/slv-k8s-job:${{ github.ref_name }}
ghcr.io/${{ github.repository }}/slv-k8s-job:latest
pages:
name: Deploy to GitHub Pages
needs: release-core
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare pages directory
run: |
cp scripts/install/* pages/
mkdir -p pages/k8s/samples/deploy
cp internal/k8s/config/crd/bases/slv.oss.amagi.com_slvs.yaml pages/k8s/crd.yaml
cp internal/k8s/deploy/operator.yaml pages/k8s/samples/deploy/operator.yaml
cp internal/k8s/deploy/job.yaml pages/k8s/samples/deploy/job.yaml
cp internal/k8s/config/samples/slv_v1_slv.yaml pages/k8s/samples/pets.slv.yaml
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4