Skip to content

Commit f0d83aa

Browse files
authored
Merge pull request #1 from kingdon-ci/update-deploy-workflow
Add signatures, Flux OCI to deploy workflow
2 parents 54c0272 + e2a3db6 commit f0d83aa

File tree

6 files changed

+75
-0
lines changed

6 files changed

+75
-0
lines changed

.github/workflows/deploy.yml

+42
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
ref: test-stimulus
2828
path: website
2929

30+
# Prerequisites:
3031
- name: Setup Hugo
3132
uses: peaceiris/actions-hugo@v3
3233
with:
@@ -43,6 +44,7 @@ jobs:
4344
with:
4445
go-version: '^1.21.0'
4546

47+
# Build:
4648
- name: Build content
4749
env:
4850
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -56,6 +58,7 @@ jobs:
5658
- name: Install Spin
5759
uses: fermyon/actions/spin/setup@v1
5860

61+
# Push: WASM
5962
- name: Push to OCI
6063
id: push
6164
uses: fermyon/actions/spin/push@v1
@@ -66,8 +69,47 @@ jobs:
6669
registry_reference: "ghcr.io/kingdon-ci/flux-docs/build:${{ github.run_id }}-2"
6770
manifest_file: spin.toml
6871

72+
# Deploy:
6973
- name: Deploy to Fermyon Cloud
7074
uses: fermyon/actions/spin/deploy@v1
7175
with:
7276
fermyon_token: ${{ secrets.FERMYON_CLOUD_TOKEN }}
7377
run_build: false
78+
79+
- name: Set up Flux CLI
80+
uses: fluxcd/flux2/[email protected]
81+
82+
# Update: Kubernetes manifests
83+
- name: Set Image (Kustomize SpinApp)
84+
run: |
85+
pushd deploy/spin-app
86+
kustomize edit set image flux-docs/build=ghcr.io/kingdon-ci/flux-docs/build:${{ github.run_id }}-2
87+
popd
88+
89+
# Push: Kubernetes (Flux App)
90+
- name: Push manifests
91+
run: |
92+
flux push artifact \
93+
oci://ghcr.io/kingdon-ci/flux-docs/manifests:latest \
94+
--path=deploy \
95+
--source=${{ github.repositoryUrl }} \
96+
--revision="${{ github.ref_name }}@sha1:${{ github.sha }}" \
97+
--annotations='org.opencontainers.image.description=Fluxcd.io website SpinKube manifests'
98+
99+
- name: Install cosign
100+
uses: sigstore/[email protected]
101+
102+
- name: Cosign version
103+
run: cosign version
104+
105+
# Sign: Kubernetes manifests
106+
- name: Sign OCI YAML manifests
107+
run: |
108+
# keyless mode
109+
cosign sign ghcr.io/kingdon-ci/flux-docs/manifests:latest -y
110+
111+
# Sign: Spin app OCI artifact
112+
- name: Sign OCI WASM artifact
113+
run: |
114+
# keyless mode
115+
cosign sign ghcr.io/kingdon-ci/flux-docs/build:${{ github.run_id }}-2 -y

deploy/spin-app/images-config.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
images:
2+
- path: spec/image
3+
kind: SpinApp

deploy/spin-app/kustomization.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: default
4+
resources:
5+
- spinapp.yaml
6+
images:
7+
- name: flux-docs/build
8+
newname: ghcr.io/kingdon-ci/flux-docs/build # image:name
9+
newtag: updateme # image:tag
10+
configurations:
11+
- images-config.yaml

deploy/spin-app/spinapp.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: core.spinoperator.dev/v1alpha1
2+
kind: SpinApp
3+
metadata:
4+
name: flux-docs
5+
spec:
6+
image: "flux-docs/build:updateme"
7+
replicas: 2

deploy/spin-infra/kustomization.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
kind: Kustomization
2+
namespace: default
3+
resources:
4+
- spin-operator.shim-executor.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: core.spinoperator.dev/v1alpha1
2+
kind: SpinAppExecutor
3+
metadata:
4+
name: containerd-shim-spin
5+
spec:
6+
createDeployment: true
7+
deploymentConfig:
8+
runtimeClassName: wasmtime-spin-v2

0 commit comments

Comments
 (0)