Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Travis to GitHub Actions #63

Merged
merged 4 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches:
- deploy
pull_request:
branches:
- master

jobs:
build:
name: Build app
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to bump our python version 3.5 is now EOL. This is probably a separate issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another a great question. Opened #65.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(My answer is not yet because the OCD scrapers on the server are still using Python 3.5.)

uses: actions/setup-python@v2
with:
python-version: '3.5'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrading setuptools resolved the build error we've been seeing in Travis. Reference: django-haystack/django-haystack#1571 (comment)

pip install --upgrade -r requirements.txt
deploy:
needs: build
name: Deploy to AWS
runs-on: ubuntu-latest
steps:
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- uses: actions/checkout@v2
- id: deploy
uses: webfactory/[email protected]
with:
application: scrapers-us-municipal
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,18 @@ LastPass. The underlying code is in the [`datamade/la-metro-dashboard` repositor

### Deploying changes

This repo uses Travis for continuous integration and deployment. To trigger a production deployment, [create and push a tag](https://github.com/datamade/deploy-a-site/blob/8efe413f18383caa0cb5c81373f817afd6a944d7/How-to-deploy-with-continuous-deployment.md#3-deploy-to-production) matching the regular expression at the top of [`.travis.yml`](.travis.yml). Pushing a tag will deploy the code to the OCD server (for scrapes scheduled by cron) and create a Docker Hub build in the [`datamade/scrapers-us-municipal` repository](https://hub.docker.com/repository/docker/datamade/scrapers-us-municipal) (for scrapes scheduled by Airflow, which are run in containers).
This repo uses GitHub Actions for continuous integration and deployment. To
trigger a production deployment, sync the `master` branch with the `deploy`
branch:

```bash
git push origin master:deploy
```

Pushing to the `deploy` branch will deploy the code to the OCD server (for
scrapes scheduled by cron) and create a Docker Hub build in the [`datamade/scrapers-us-municipal`
repository](https://hub.docker.com/repository/docker/datamade/scrapers-us-municipal)
(for scrapes scheduled by Airflow, which are run in containers).

## Logging

Expand Down
5 changes: 4 additions & 1 deletion appspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ hooks:
AfterInstall:
- location: scripts/after_install.sh
timeout: 1000
runas: root
runas: root

deploy:
deploymentGroupName: production
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
django>=2.2,<2.3
opencivicdata>=3.1.0
# Better handling for loading divisions from specified CSV
https://github.com/opencivicdata/python-opencivicdata/archive/master.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to peg this to a specific version, or have it float like this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question. I opened #64 and once I finish up datamade/how-to#210, let us pin!


# Resolve memberships with the same start date
https://github.com/opencivicdata/pupa/archive/0817852d4694cd49651d01a7b957a022be2d4a4d.zip
Expand Down