Skip to content

PNAPL-765: new way of loading GitHub secrets (#20) #12

PNAPL-765: new way of loading GitHub secrets (#20)

PNAPL-765: new way of loading GitHub secrets (#20) #12

name: Publish Workflow
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.16.1"
registry-url: https://registry.npmjs.org
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: ${{ vars.AWS_IAM_ROLE_ARN }}
- uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
parse-json-secrets: true
secret-ids: NPM_USER,${{ vars.NPM_USER_SECRET_ARN }}
- id: super-cache
uses: mangs/super-cache-action@v3
- if: steps.super-cache.outputs.cache-hit != 'true'
run: npm ci
# Task execution
- run: npm run validate:environment
- run: npm run build:vite
- run: npm run build:types
- uses: mangs/simple-release-notes-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ env.NPM_USER_ACCESS_TOKEN }}