diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..684e925 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,60 @@ +name: Deploy + +on: + push: + branches: [master] + + pull_request: + branches: + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + init: + runs-on: [self-hosted, fear] + outputs: + skip: ${{ steps.ci-skip-step.outputs.ci-skip }} + skip-not: ${{ steps.ci-skip-step.outputs.ci-skip-not }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: mstachniuk/ci-skip@master + id: ci-skip-step + with: + commit-filter: '[skip ci]' + deploy_aws: + name: Deploy + runs-on: [self-hosted, fear] + needs: init + if: ${{ needs.init.outputs.skip == 'false' }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + # Use custom token from repo secrets to allow semantic release to push commit: + # https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/github-actions.md#pushing-packagejson-changes-to-a-master-branch + persist-credentials: false + token: ${{ secrets.GH_TOKEN }} + - uses: actions/setup-node@v1 + with: + node-version: '14' + - run: npm config set '//npm.pkg.github.com/:_authToken' $GH_TOKEN + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + - run: npm config set @typeform:registry https://npm.pkg.github.com/ + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + - run: npm run install:$GH_TOKEN + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + - run: npm test + + - name: After Success + if: contains(github.ref, 'refs/heads/master') + run: npm publish + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/secrets-scans.yml b/.github/workflows/secrets-scans.yml new file mode 100644 index 0000000..62945bb --- /dev/null +++ b/.github/workflows/secrets-scans.yml @@ -0,0 +1,24 @@ +name: Secrets Scan + +on: [push, pull_request] + +jobs: + secrets-scan: + # for private repositories + # runs-on: [self-hosted, automated-checks] + # for public repositories + runs-on: [ubuntu-latest] + + steps: + - name: Check Out Source Code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Secrets Scan + uses: Typeform/.github/shared-actions/secrets-scan@master + with: + docker-registry: ${{ secrets.DOCKER_REGISTRY }} + docker-username: ${{ secrets.DOCKER_USERNAME }} + docker-password: ${{ secrets.DOCKER_PASSWORD }} + gh-token: ${{ secrets.GH_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ec38056..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: required -dist: trusty - -language: node_js - -node_js: - - "8" - -cache: - directories: - - node_modules - - $HOME/.nvm - - $HOME/.npm - -script: - - npm run install:token - - npm test - -after_success: - - test "${TRAVIS_BRANCH}" = "master" -a "${TRAVIS_PULL_REQUEST}" = "false" && npm publish