version: 2.1
orbs:
  vault: contentful/vault@1
jobs:
  release:
    docker:
      - image: cimg/node:22.10.0
    steps:
      - checkout
      - vault/get-secrets:
          template-preset: "semantic-release"
      - run: |-
          echo "//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_WRITE_TOKEN}" > ~/.npmrc
          echo "@contentful:registry=https://npm.pkg.github.com" >> ~/.npmrc
      - run: npm ci
      - run: npm run build
      - run: npm run test
      - run: npm run release


workflows:
  build:
    jobs:
      - release:
          context:
            - vault
