-
Notifications
You must be signed in to change notification settings - Fork 40
Luke large patch 4 #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
152d7a9
71abcb3
660a0e6
75e5586
d36e6b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||
| # This workflow uses actions that are not certified by GitHub. | ||||||
| # They are provided by a third-party and are governed by | ||||||
| # separate terms of service, privacy policy, and support | ||||||
| # documentation. | ||||||
|
|
||||||
| # This workflow lets you compile your Go project using a SLSA3 compliant builder. | ||||||
| # This workflow will generate a so-called "provenance" file describing the steps | ||||||
| # that were performed to generate the final binary. | ||||||
| # The project is an initiative of the OpenSSF (openssf.org) and is developed at | ||||||
| # https://github.com/slsa-framework/slsa-github-generator. | ||||||
| # The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier. | ||||||
| # For more information about SLSA and how it improves the supply-chain, visit slsa.dev. | ||||||
|
|
||||||
| name: SLSA Go releaser | ||||||
| on: | ||||||
| workflow_dispatch: | ||||||
| release: | ||||||
| types: [created] | ||||||
|
|
||||||
| permissions: read-all | ||||||
|
|
||||||
| jobs: | ||||||
| # ======================================================================================================================================== | ||||||
| # Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project. | ||||||
| # See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file | ||||||
| #========================================================================================================================================= | ||||||
| build: | ||||||
| permissions: | ||||||
| id-token: write # To sign. | ||||||
| contents: write # To upload release assets. | ||||||
| actions: read # To read workflow path. | ||||||
| uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v1.4.0 | ||||||
| with: | ||||||
| go-version: 1.17 | ||||||
|
||||||
| go-version: 1.17 | |
| go-version: 1.20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # This workflow will build a golang project | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
|
||
| name: Go | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| jobs: | ||
|
|
||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v4 | ||
| with: | ||
| go-version: '1.20' | ||
|
|
||
| - name: Build | ||
| run: go build -v ./... | ||
|
|
||
| - name: Test | ||
| run: go test -v ./... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # This workflow will build a docker container, publish it to IBM Container Registry, and deploy it to IKS when there is a push to the "main" branch. | ||
| # | ||
| # To configure this workflow: | ||
| # | ||
| # 1. Ensure that your repository contains a Dockerfile | ||
| # 2. Setup secrets in your repository by going to settings: Create ICR_NAMESPACE and IBM_CLOUD_API_KEY | ||
| # 3. Change the values for the IBM_CLOUD_REGION, REGISTRY_HOSTNAME, IMAGE_NAME, IKS_CLUSTER, DEPLOYMENT_NAME, and PORT | ||
|
|
||
| name: Build and Deploy to IKS | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
|
|
||
| # Environment variables available to all jobs and steps in this workflow | ||
| env: | ||
| GITHUB_SHA: ${{ github.sha }} | ||
| IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY }} | ||
| IBM_CLOUD_REGION: us-south | ||
| ICR_NAMESPACE: ${{ secrets.ICR_NAMESPACE }} | ||
| REGISTRY_HOSTNAME: us.icr.io | ||
| IMAGE_NAME: iks-test | ||
| IKS_CLUSTER: example-iks-cluster-name-or-id | ||
| DEPLOYMENT_NAME: iks-test | ||
| PORT: 5001 | ||
|
|
||
| jobs: | ||
| setup-build-publish-deploy: | ||
| name: Setup, Build, Publish, and Deploy | ||
| runs-on: ubuntu-latest | ||
| environment: production | ||
| steps: | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # Download and Install IBM Cloud CLI | ||
| - name: Install IBM Cloud CLI | ||
| run: | | ||
| curl -fsSL https://clis.cloud.ibm.com/install/linux | sh | ||
| ibmcloud --version | ||
| ibmcloud config --check-version=false | ||
| ibmcloud plugin install -f kubernetes-service | ||
| ibmcloud plugin install -f container-registry | ||
| # Authenticate with IBM Cloud CLI | ||
| - name: Authenticate with IBM Cloud CLI | ||
| run: | | ||
| ibmcloud login --apikey "${IBM_CLOUD_API_KEY}" -r "${IBM_CLOUD_REGION}" -g default | ||
| ibmcloud cr region-set "${IBM_CLOUD_REGION}" | ||
| ibmcloud cr login | ||
| # Build the Docker image | ||
| - name: Build with Docker | ||
| run: | | ||
| docker build -t "$REGISTRY_HOSTNAME"/"$ICR_NAMESPACE"/"$IMAGE_NAME":"$GITHUB_SHA" \ | ||
| --build-arg GITHUB_SHA="$GITHUB_SHA" \ | ||
| --build-arg GITHUB_REF="$GITHUB_REF" . | ||
| # Push the image to IBM Container Registry | ||
| - name: Push the image to ICR | ||
| run: | | ||
| docker push $REGISTRY_HOSTNAME/$ICR_NAMESPACE/$IMAGE_NAME:$GITHUB_SHA | ||
| # Deploy the Docker image to the IKS cluster | ||
| - name: Deploy to IKS | ||
| run: | | ||
| ibmcloud ks cluster config --cluster $IKS_CLUSTER | ||
| kubectl config current-context | ||
| kubectl create deployment $DEPLOYMENT_NAME --image=$REGISTRY_HOSTNAME/$ICR_NAMESPACE/$IMAGE_NAME:$GITHUB_SHA --dry-run -o yaml > deployment.yaml | ||
| kubectl apply -f deployment.yaml | ||
| kubectl rollout status deployment/$DEPLOYMENT_NAME | ||
| kubectl create service loadbalancer $DEPLOYMENT_NAME --tcp=80:$PORT --dry-run -o yaml > service.yaml | ||
| kubectl apply -f service.yaml | ||
| kubectl get services -o wide |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Security Policy | ||
|
|
||
| ## Supported Versions | ||
|
|
||
| Use this section to tell people about which versions of your project are | ||
| currently being supported with security updates. | ||
|
|
||
| | Version | Supported | | ||
| | ------- | ------------------ | | ||
| | 5.1.x | :white_check_mark: | | ||
| | 5.0.x | :x: | | ||
| | 4.0.x | :white_check_mark: | | ||
| | < 4.0 | :x: | | ||
|
|
||
| ## Reporting a Vulnerability | ||
|
|
||
| Use this section to tell people how to report a vulnerability. | ||
|
|
||
| Tell them where to go, how often they can expect to get an update on a | ||
| reported vulnerability, what to expect if the vulnerability is accepted or | ||
| declined, etc. | ||
|
Comment on lines
+1
to
+21
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a spelling error in the comment. "Prerequesite" should be "Prerequisite".