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 2cfc80a commit fb4f152
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 14 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,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 @@ -36,6 +54,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 }}
14 changes: 6 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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

- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: '14'

Expand All @@ -37,4 +36,3 @@ jobs:

- name: Run unit tests
run: CHROME_BIN=`which chrome || which chromium-browser` ENV_BROWSER=Chrome_headless npm run test

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: Use Node.js
uses: actions/setup-node@v1
Expand Down

0 comments on commit fb4f152

Please sign in to comment.