Skip to content

Commit

Permalink
GHA migration: secrets check (rancher#365)
Browse files Browse the repository at this point in the history
* added steps to read migrated secrets

* fixed indentation and naming
  • Loading branch information
enrichman authored Apr 24, 2024
1 parent 36d1121 commit a85cc10
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI

on:
workflow_dispatch:
push:
pull_request:

Expand All @@ -9,7 +10,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout Repo
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v5
Expand All @@ -25,3 +27,24 @@ jobs:

- name: Build
run: make build

fossa:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # needed for the Vault authentication

steps:
- name: Load Secrets from Vault
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/fossa/credentials token | FOSSA
- name: Checkout Repo
uses: actions/checkout@v3

- name: Check FOSSA compliance
uses: fossas/fossa-action@main
with:
api-key: ${{ env.FOSSA }}
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
workflow_dispatch:
push:
tags:
- v*

jobs:
release:
permissions:
contents: read
id-token: write # needed for the Vault authentication
runs-on: ubuntu-latest

steps:
- name: Load Secrets from Vault
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ;
secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD ;
- name: Checkout Repo
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}

0 comments on commit a85cc10

Please sign in to comment.