generated from degauss-org/degauss_template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent ties returning two tracts for one point (#14)
* prevent ties returning two tracts for one point * update renv * add gha build * gha syntax * try again * add year argument to gha test * update v Co-authored-by: Erika <erika.rasnick@gmail.com>
- Loading branch information
1 parent
c85514a
commit 739d512
Showing
7 changed files
with
401 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Build & Deploy Docker Containers | ||
on: | ||
# We'll trigger this workflow when a PR is submitted to make sure | ||
# your application still builds successfully with the new commits. | ||
pull_request: [] | ||
# We'll also trigger this workflow when you want to deploy your container. | ||
# This means any push to main. You might want to do a release trigger. | ||
push: | ||
branches: | ||
- main | ||
- master | ||
# Let's also trigger a build and publish of your container when | ||
# you release a new version. You can use "created" here instead of published. | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
deploy-images: | ||
runs-on: ubuntu-latest | ||
|
||
# Define your registry and repository here. | ||
# These are for the GitHub Container registry, you can also use | ||
# Quay.io or another OCI registry | ||
env: | ||
registry: ghcr.io | ||
username: degauss-org | ||
repository: census_block_group | ||
|
||
strategy: | ||
# Even if one docker container build fails we want the others to continue. | ||
fail-fast: false | ||
# A matrix of Dockerfile paths and associated tags | ||
# Dockerfile in root builds to tag latest | ||
matrix: | ||
dockerfile: [[Dockerfile, latest]] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set Container Tag Normal | ||
run: | | ||
container="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:${{ matrix.dockerfile[1] }}" | ||
echo "container=${container}" >> $GITHUB_ENV | ||
# On a new release create a container with the same tag as the release. | ||
- name: Set Container Tag Release | ||
if: github.event_name == 'release' | ||
run: | | ||
versioned="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:${GITHUB_REF##*/}" | ||
echo "versioned=${versioned}" >> $GITHUB_ENV | ||
# On a PR create a "test" container with the same tag as the branch name. | ||
- name: Set Branch Tag Release | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
versioned="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:${GITHUB_HEAD_REF}" | ||
echo "versioned=${versioned}" >> $GITHUB_ENV | ||
- name: Build ${{ matrix.dockerfile[1] }} | ||
run: | | ||
printf "Preparing to build ${{ env.container }} from ${{ matrix.dockerfile[0] }}" | ||
if [ ! -f "${{ matrix.dockerfile[0]}}" ]; then | ||
printf "Dockerfile ${{ matrix.dockerfile[0] }} does not exist" | ||
exit 1; | ||
fi | ||
docker build -f ${{ matrix.dockerfile[0] }} -t ${{ env.container }} . | ||
docker images | ||
- name: Test ${{ matrix.dockerfile[1] }} | ||
run: | | ||
printf "Testing ${{ env.container }}" | ||
docker run --rm -v "${PWD}/test":/tmp ${{ env.container }} my_address_file_geocoded.csv 2010 | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.registry }} | ||
username: ${{ env.username }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Example variables for a non GitHub registry like Quay or Docker Hub | ||
# username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# Deploy branch container on pull request | ||
- name: Test Deploy ${{ env.versioned }} | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
docker tag ${{ env.container }} ${{ env.versioned }} | ||
docker push ${{ env.versioned }} | ||
# Deploy release container on release | ||
- name: Deploy ${{ env.versioned }} | ||
if: github.event_name == 'release' | ||
run: | | ||
docker tag ${{ env.container }} ${{ env.versioned }} | ||
docker push ${{ env.versioned }} | ||
docker push ${{ env.container }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
local/ | ||
lock/ | ||
library/ | ||
python/ | ||
|
Oops, something went wrong.