-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cf3c335
Showing
18 changed files
with
2,996 additions
and
0 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,8 @@ | ||
# ignore everything | ||
** | ||
|
||
# except what we need | ||
!/pm25_iweek_startdate.csv | ||
!/habre.tif | ||
!/renv.lock | ||
!/entrypoint.R |
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,40 @@ | ||
name: build-deploy-pr | ||
on: | ||
pull_request: | ||
jobs: | ||
deploy-images: | ||
runs-on: ubuntu-latest | ||
env: | ||
registry: ghcr.io | ||
username: degauss-org | ||
repository: habre_pm | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: create latest tag variable | ||
run: | | ||
container="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:latest" | ||
echo "container=${container}" >> $GITHUB_ENV | ||
- name: create pull request tag variable based on name of associated branch | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
versioned="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:${GITHUB_HEAD_REF}" | ||
echo "versioned=${versioned}" >> $GITHUB_ENV | ||
- name: build container | ||
run: | | ||
docker build -t ${{ env.container }} . | ||
- name: test run container | ||
run: | | ||
docker run --rm -v "${PWD}/test":/tmp ${{ env.container }} my_address_file_geocoded.csv | ||
- name: login to ghcr | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.registry }} | ||
username: ${{ env.username }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: deploy pull request container | ||
run: | | ||
docker tag ${{ env.container }} ${{ env.versioned }} | ||
docker push ${{ env.versioned }} |
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,42 @@ | ||
name: build-deploy-release | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
deploy-images: | ||
runs-on: ubuntu-latest | ||
env: | ||
registry: ghcr.io | ||
username: degauss-org | ||
repository: habre_pm | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: create latest tag variable | ||
run: | | ||
container="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:latest" | ||
echo "container=${container}" >> $GITHUB_ENV | ||
- name: create release tag variable | ||
if: github.event_name == 'release' | ||
run: | | ||
versioned="${{ env.registry }}/${{ env.username}}/${{ env.repository }}:${GITHUB_REF##*/}" | ||
echo "versioned=${versioned}" >> $GITHUB_ENV | ||
- name: build container | ||
run: | | ||
docker build -t ${{ env.container }} . | ||
- name: test container | ||
run: | | ||
docker run --rm -v "${PWD}/test":/tmp ${{ env.container }} my_address_file_geocoded.csv | ||
- name: login to ghcr | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.registry }} | ||
username: ${{ env.username }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: deploy release (and latest) container | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.Rproj.user | ||
.Rhistory | ||
.RData | ||
.Ruserdata |
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,37 @@ | ||
FROM rocker/r-ver:4.2.2 | ||
|
||
# DeGAUSS container metadata | ||
ENV degauss_name="habre_pm" | ||
ENV degauss_version="0.1.0" | ||
ENV degauss_description="weekly pm2.5 for California (Habre)" | ||
|
||
# add OCI labels based on environment variables too | ||
LABEL "org.degauss.name"="${degauss_name}" | ||
LABEL "org.degauss.version"="${degauss_version}" | ||
LABEL "org.degauss.description"="${degauss_description}" | ||
|
||
RUN R --quiet -e "install.packages('remotes', repos = c(CRAN = 'https://packagemanager.rstudio.com/all/__linux__/focal/latest'))" | ||
|
||
RUN R --quiet -e "remotes::install_github('rstudio/[email protected]')" | ||
|
||
WORKDIR /app | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -yqq --no-install-recommends \ | ||
libgdal-dev \ | ||
libgeos-dev \ | ||
libudunits2-dev \ | ||
libproj-dev \ | ||
&& apt-get clean | ||
|
||
COPY renv.lock . | ||
|
||
RUN R --quiet -e "renv::restore()" | ||
|
||
COPY habre.tif . | ||
COPY pm25_iweek_startdate.csv . | ||
COPY entrypoint.R . | ||
|
||
WORKDIR /tmp | ||
|
||
ENTRYPOINT ["/app/entrypoint.R"] |
Oops, something went wrong.