Skip to content

Commit

Permalink
chore: read secrets from Akeyeless
Browse files Browse the repository at this point in the history
  • Loading branch information
tsvetomir committed May 18, 2023
1 parent 48ec308 commit 64db9ef
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 11 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,28 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: upload

permissions:
id-token: write # Required by Akeyless
contents: read
packages: read

steps:
- name: Import Secrets
id: import-secrets
uses: LanceMcCarthy/akeyless-action@v3
with:
access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
static-secrets: |
{
"/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN",
"/WebComponents/prod/tokens/PROGRESS_NPM_REGISTRY_TOKEN": "NPM_TOKEN"
}
export-secrets-to-environment: false

- name: Check out branch
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all branches

Expand All @@ -37,6 +55,5 @@ jobs:
- name: Publish release
run: npx ci-semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}

NPM_TOKEN: ${{ steps.import-secrets.outputs.NPM_TOKEN }}
GH_TOKEN: ${{ steps.import-secrets.outputs.GH_TOKEN }}
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: Check out repository
uses: actions/checkout@v2

Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,26 @@ jobs:
build:
runs-on: ubuntu-latest

permissions:
id-token: write # Required by Akeyless
contents: read
packages: read

steps:
- name: Import Secrets
id: import-secrets
uses: LanceMcCarthy/akeyless-action@v3
with:
access-id: ${{ secrets.GH_AKEYLESS_ACCESS_ID }}
static-secrets: '{ "/WebComponents/prod/tokens/GH_TOKEN": "GH_TOKEN" }'
export-secrets-to-environment: false

- name: Check out master
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0 # Fetch all branches
token: ${{ secrets.GH_TOKEN }}
token: ${{ steps.import-secrets.outputs.GH_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v2
Expand Down

0 comments on commit 64db9ef

Please sign in to comment.