Skip to content

Commit

Permalink
Merge pull request #41: Migrate CI from Travis → GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin authored May 4, 2022
2 parents 5e61a58 + 01563c2 commit 3360407
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 49 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set CACHE_DATE
run: echo "CACHE_DATE=$(date --utc +%Y%m%dT%H%M%SZ)" >> $GITHUB_ENV
- run: ./devel/pull
- run: ./devel/build
- if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_PASSWORD }}
- if: ${{ github.event_name != 'pull_request' && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
run: |
./devel/tag build-$CACHE_DATE
./devel/push latest build-$CACHE_DATE
- if: ${{ github.event_name != 'pull_request' && github.ref_type == 'branch' && github.ref_name != github.event.repository.default_branch }}
# From `man docker-image-tag`: The tag name must be valid ASCII and may
# contain lowercase and uppercase letters, digits, underscores, periods
# and hyphens.
run: |
tag=branch-${GITHUB_REF_NAME//[^A-Za-z0-9._-]/-}
./devel/tag $tag
./devel/push $tag
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tool][nextstrain-cli].

### Rebuilding an image and pushing to Docker Hub

To rebuild the image with the latest versions of its software and push to Docker Hub, go to [the Travis CI interface for this repository](https://app.travis-ci.com/github/nextstrain/docker-base) and select the "Trigger build" option under "More options...".
To rebuild the image with the latest versions of its software and push to Docker Hub, go to [the GitHub Actions workflow](https://github.com/nextstrain/docker-base/actions/workflows/ci.yml), select **Run workflow**, and confirm.
This is most helpful when you want the image to contain the latest version of a tool whose release does not automatically trigger a new build of the image and you do not need to modify the `Dockerfile`.

### Building
Expand Down Expand Up @@ -75,17 +75,16 @@ details of each Dockerfile command (`COPY`, `ADD`, etc).

### Continuous integration

Every push to this repository triggers a new build of the image on [Travis
CI][]. This helps ensure the image builds successfully with the new commits.
Every push to this repository triggers a new build of the image [a GitHub Actions workflow][]. This helps ensure the image builds successfully with the new commits.

Images built from the `master` branch are additionally pushed to the [Docker
registry][`nextstrain/base`]. The build instructions used by Travis are in
this repo's `.travis.yml`.
registry][`nextstrain/base`]. The build instructions used by the workflow are in
this repo's `.github/workflows/ci.yml`.


[`nextstrain/base`]: https://hub.docker.com/r/nextstrain/base/
["slim" Python image]: https://hub.docker.com/_/python
[multi-stage build]: https://docs.docker.com/develop/develop-images/multistage-build/
[Docker best practices]: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
[Dockerfile reference documentation]: https://docs.docker.com/engine/reference/builder/
[Travis CI]: https://travis-ci.com/nextstrain/docker-base/
[GitHub Actions]: https://github.com/nextstrain/docker-base/actions/workflows/ci.yml
27 changes: 0 additions & 27 deletions devel/push-from-travis

This file was deleted.

0 comments on commit 3360407

Please sign in to comment.