From fef9ac2feec702e895c60ad6236a4f4befa5bc19 Mon Sep 17 00:00:00 2001 From: Justin Debbink Date: Fri, 20 Sep 2024 13:53:22 -0500 Subject: [PATCH] Migrate CI to Github Actions (#582) * Migrate CI to Github Actions * Publish --- .github/workflows/build.yml | 39 +++++++++++++++++++++++ .gitlab-ci.yml | 62 ------------------------------------- .nvmrc | 2 +- 3 files changed, 40 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..19281b7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build + +on: + push: + branches: + - master + tags: + - 'v*' + pull_request: + branches: + - master + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7 + - name: Setup Node + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # 4.0.3 + with: + node-version-file: .nvmrc + cache: 'yarn' + - name: Install dependencies + run: yarn install + - name: Lint + run: yarn lint + - name: Build + run: yarn build + - name: Test + run: yarn test + - name: Publish + if: startsWith(github.ref, 'refs/tags/v') + run: | + echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}'>.npmrc + npm publish diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 81117f7..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,62 +0,0 @@ -image: docker.gamechanger.io/node:18.16.0-alpine3.16 - -stages: - - setup - - test - - deploy - -install: - stage: setup - script: - - yarn install - interruptible: true - artifacts: - name: 'node-modules-$CI_COMMIT_REF_NAME' - expire_in: 1 hour - paths: - - node_modules/ - only: - refs: - - branches - - tags - -lint: - stage: test - script: - - yarn lint - interruptible: true - only: - refs: - - branches - - tags - -test: - stage: test - script: - - yarn test - only: - refs: - - branches - - tags - -compile: - stage: test - script: - - yarn build - artifacts: - name: 'lib-$CI_COMMIT_REF_NAME' - expire_in: 1 hour - paths: - - lib/ - only: - refs: - - branches - - tags - -publish: - stage: deploy - script: - - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc - - npm publish - only: - - tags diff --git a/.nvmrc b/.nvmrc index c85fa1b..3c79f30 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.17.1 +18.16.0 \ No newline at end of file