diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..7ee4d23 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,19 @@ +name: CD +on: + push: + branches: [ develop ] +# pull_request: +# branches: [ develop ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Trigger CD build + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.CI_DISPATCH_TOKEN }} + repository: forensic-architecture/configs + event-type: remote-build + client-payload: '{"runtime_args": "datasheet", "branch": "${GITHUB_REF##*/}"}' + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..591401a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2-beta + with: + node-version: '12' + + - run: npm install + - run: npm test + - run: npm run lint + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 9e8cd0a..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the develop branch -on: - push: - branches: [ develop ] - pull_request: - branches: [ develop ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - test: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2-beta - with: - node-version: '12' - - - run: npm install - - run: npm test - - run: npm run lint - diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1df6ad7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js -node_js: -- stable -cache: - directories: - - node_modules -before_script: -- npm install -g yarn -install: -- yarn -script: -- yarn build -- yarn lint -- yarn test diff --git a/scripts/check-branch.sh b/scripts/check-branch.sh deleted file mode 100755 index 5d0983b..0000000 --- a/scripts/check-branch.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -ENCRYPT_MESSAGE="\nThe .env.enc file has not changed its contents from the version on origin/develop.\nTo ensure that tests pass in Travis, you need to encrypt the contents of .env before pushing to the remote, so that the Travis server can use your service account credentials.\nEnsure that the Travis CLI is installed on your local, run\n\n\tnpm run travis-encrypt\n\nand then push to the remote again.\nIf you don't care whether your build passes on Travis, you can run:\n\n\tgit push --no-verify\n\nand bypass this check.\n\n" - -# check whether .env.enc has changed -if [ -z "`git diff origin/develop -- .env.enc`" ]; then - echo $ENCRYPT_MESSAGE - exit 1 -fi - - diff --git a/scripts/encrypt.sh b/scripts/encrypt.sh deleted file mode 100755 index 1609b0b..0000000 --- a/scripts/encrypt.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -echo "Encrypting .env file for Travis..." - -# confirm that the user has the core repo as origin, and is therefore a maintainer -# if [ -z `git config --get remote.origin.url | grep "forensic-architecture/datasheet-server"` ]; then -# echo "Travis encryption not required for satellite contributors, continuing.." -# exit 0 -# fi - -# confirm travis is installed -if [ ! hash travis 2>/dev/null ]; then - echo "============================================================================================" - echo "ERROR: Travis CLI is not installed on your local. Please install from:" - echo "\thttps://github.com/travis-ci/travis.rb" - echo "After installing, make sure that you login with:" - echo "\ttravis login --pro" - echo "============================================================================================" - exit 3 -fi - -# confirm there is a .env file to encrypt -if [ ! -f .env ]; then - echo "============================================================================================" - echo "ERROR: You must create a .env file and add your credentials. See .env.example for an example" - echo "============================================================================================" - exit 3 -fi - -# regex to match and delete 'before_install' and everything after it -# necessary to delete these lines to get Travis to build for multiple accounts -echo "creating new .travis.yml configuration" -sed -i.old '/^before_install.*/,$ d' .travis.yml -echo "old config file saved as .travis.yml.old" - -travis encrypt-file .env --add --force --org -git add .env.enc -git add .travis.yml -echo ".env.enc created and added to commit"