Skip to content

Commit

Permalink
Move from TravisCI to GitHub Actions
Browse files Browse the repository at this point in the history
This moves the CI configuration from TravisCI, which we're no longer using
after their disasterous response to a huge security vulnerability, to GitHub
Actions.

It uses a templated GitHub Actions workflow file, which should be mostly
identical between all repositories.

Along the way some other nice goodies are included:
- Run all tests against Node.js 12, 14, and 16
- Run docker build _after_ any NPM publish, so that versioned docker images can be built
- Remove any CircleCI config that exists (we can use Github Actions to build docker images just fine)
- Remove any other lingering references to TravisCI
  • Loading branch information
orangejulius committed Sep 23, 2021
1 parent b4b598a commit 662a1bb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,21 @@ jobs:
if [[ -n "$GH_TOKEN" && -n "$NPM_TOKEN" ]]; then
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/semantic-release.sh" | bash -
fi
build-docker-images:
# run this job if the unit tests passed and the npm-publish job was a success or was skipped
# note: github actions won't run a job if you don't call one of the status check functions, so `always()` is called since it evalutes to `true`
if: ${{ always() && needs.unit-tests.result == 'success' && (needs.npm-publish.result == 'success' || needs.npm-publish.result == 'skipped') }}
needs: [unit-tests, npm-publish]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Dump needs context
env:
NEEDS_CONTEXT: ${{ toJSON(needs) }}
run: echo "$NEEDS_CONTEXT"
- name: Build Docker images
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/build-docker-images.sh" | bash -

0 comments on commit 662a1bb

Please sign in to comment.