test #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
# write is needed for: | |
# - OIDC for cosign's use in ecm-distro-tools/publish-image. | |
# - Read vault secrets in rancher-eio/read-vault-secrets. | |
id-token: write | |
strategy: | |
matrix: | |
include: | |
- target: controller | |
rancher_target: neuvector-controller | |
make-target: push-controller-image | |
platforms: linux/amd64,linux/arm64 | |
- target: enforcer | |
rancher_target: neuvector-enforcer | |
make-target: push-enforcer-image | |
platforms: linux/amd64,linux/arm64 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get controller | |
env: | |
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
run: | | |
gh release download ${{ github.ref_name }} -D controller/ -p controller-amd64 -R neuvector/neuvector-private | |
gh release download ${{ github.ref_name }} -D controller/ -p controller-arm64 -R neuvector/neuvector-private | |
gh release download ${{ github.ref_name }} -D controller/ -p sha256sum-controller-amd64 -R neuvector/neuvector-private | |
gh release download ${{ github.ref_name }} -D controller/ -p sha256sum-controller-arm64 -R neuvector/neuvector-private | |
cd controller | |
cat sha256sum-controller-amd64 | sha256sum --check | |
cat sha256sum-controller-arm64 | sha256sum --check | |
- name: Publish manifest | |
uses: rancher/ecm-distro-tools/actions/publish-image@master | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
PRIME_REGISTRY: ${{ secrets.PRIME_REGISTRY }} | |
PRIME_REGISTRY_USERNAME: ${{ secrets.PRIME_REGISTRY_USERNAME }} | |
PRIME_REGISTRY_PASSWORD: ${{ secrets.PRIME_REGISTRY_PASSWORD }} | |
with: | |
image: ${{ matrix.rancher_target }} | |
tag: ${{ github.ref_name }} | |
platforms: ${{ matrix.platforms }} | |
make-target: ${{ matrix.make-target }} | |
public-registry: docker.io | |
public-repo: holyspectral | |
public-username: ${{ env.DOCKER_USERNAME }} | |
public-password: ${{ env.DOCKER_PASSWORD }} | |
prime-registry: ${{ env.PRIME_REGISTRY }} | |
prime-repo: holyspectral | |
prime-username: ${{ env.PRIME_REGISTRY_USERNAME }} | |
prime-password: ${{ env.PRIME_REGISTRY_PASSWORD }} | |
- name: Login to registry | |
uses: docker/login-action@v3 | |
with: | |
registry: docker.io | |
username: ${{ secrets.NV_DOCKER_USERNAME }} | |
password: ${{ secrets.NV_DOCKER_PASSWORD }} | |
- name: Publish neuvector | |
run: | | |
docker buildx imagetools create --tag docker.io/holyspectral/${{ matrix.target }}:${{ github.ref_name }} docker.io/holyspectral/${{ matrix.rancher_target }}:${{ github.ref_name }} | |