Skip to content

Commit

Permalink
Issue #1: fix passing environment variables and update to github acti…
Browse files Browse the repository at this point in the history
…ons instead of bash commands
  • Loading branch information
SonOfLope committed Jun 21, 2024
1 parent 14537d1 commit eddfc4e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/updatecsv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,25 @@ jobs:
- name: Check Out Repo
uses: actions/checkout@v4

- name: Run docker job
run: |
docker build --build-arg ARG_NEW_REPORT_URL='https://aimis-simia.agr.gc.ca/rp/index-eng.cfm?action=pR&pdctc=&r=278' --build-arg ARG_MASTERLIST_URL='https://raw.githubusercontent.com/ai-cfia/PoultryRedMeatCond/1-fix-chromedriver-pipeline-error/data/ADH-717%20-%20Poultry%20and%20Red%20Meat%20data.csv' -t update-csv .
env:
NEW_REPORT_URL: ${{ secrets.NEW_REPORT_URL }}
MASTERLIST_URL: ${{ secrets.MASTERLIST_URL }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
tags: csvscraper:latest
push: false
secret-files: |
.env
secrets: |
"NEW_REPORT_URL=${{secrets.NEW_REPORT_URL}}"
"MASTERLIST_URL=${{secrets.MASTERLIST_URL}}"
- uses: addnab/docker-run-action@v3
with:
image: csvscraper:latest
options: -v ./data:/usr/src/app/data -p 8081:8081

- name: Commit changes
uses: EndBug/add-and-commit@v9.1.4
Expand Down
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ RUN apt-get update && \
# Set the working directory
WORKDIR /usr/src/app

ARG ARG_NEW_REPORT_URL
ENV NEW_REPORT_URL=$ARG_NEW_REPORT_URL
ARG ARG_MASTERLIST_URL
ENV MASTERLIST_URL=$ARG_MASTERLIST_URL

# Copy the requirements.txt file into the container
COPY requirements.txt ./

Expand Down

0 comments on commit eddfc4e

Please sign in to comment.