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

Eliminate need for creds #28

Merged
merged 44 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f6c762e
—secrets
cansavvy Jul 14, 2024
6a4ed16
Update Dockerfile
cansavvy Jul 14, 2024
d036d4d
Update Dockerfile
cansavvy Jul 14, 2024
b09ee06
Use bash docker image
cansavvy Jul 14, 2024
fb600d4
Update docker-test.yml
cansavvy Jul 14, 2024
1e35a06
Update docker-test.yml
cansavvy Jul 14, 2024
2082931
Use v6
cansavvy Jul 14, 2024
4ad67d2
Update docker-test.yml
cansavvy Jul 14, 2024
406b7c3
Update Dockerfile
cansavvy Jul 14, 2024
ff5fef9
Update Dockerfile
cansavvy Jul 14, 2024
98a5607
Update install_github.R
cansavvy Jul 14, 2024
33ae87f
Update Dockerfile
cansavvy Jul 14, 2024
d31e916
Move install_github.R
cansavvy Jul 14, 2024
052377d
Pass in secret attempt
cansavvy Jul 14, 2024
6b67661
Try a different thing
cansavvy Jul 14, 2024
b72464e
Maybe this is how you do it?
cansavvy Jul 14, 2024
3548fdf
Forgot the /
cansavvy Jul 14, 2024
5198a2b
Lowercase
cansavvy Jul 14, 2024
4fcc4e4
Try the sed thing
cansavvy Jul 14, 2024
553856b
Bash fix?
cansavvy Jul 14, 2024
1530f38
Rearrange
cansavvy Jul 14, 2024
5322669
Forgot a quote
cansavvy Jul 14, 2024
39ba7d2
Don’t need production thing
cansavvy Jul 14, 2024
6e4d1bb
Let's see how this goes
cansavvy Jul 15, 2024
9194182
Try exact thing from example
cansavvy Jul 15, 2024
fbffb23
See if the example works with v4
cansavvy Jul 15, 2024
371786d
Maybe the default thing is important
cansavvy Jul 15, 2024
5e63a0f
Try a different thing
cansavvy Jul 15, 2024
c058f92
Update docker-test.yml
cansavvy Jul 15, 2024
2749343
Header needed?
cansavvy Jul 15, 2024
e123a58
Merge branch 'cansavvy-patch-1' of github.com:jhudsl/ottr_docker into…
cansavvy Jul 15, 2024
30445cb
Maybe this worked?
cansavvy Jul 15, 2024
7d1e38e
Let's see what happens?
cansavvy Jul 15, 2024
465e9b7
Try a different thing
cansavvy Jul 15, 2024
85cb12f
Maybe without quotes?
cansavvy Jul 15, 2024
4f71660
Will it let me read the file?
cansavvy Jul 15, 2024
7cf5dfb
Try this
cansavvy Jul 15, 2024
e318090
Try one at a time strategy
cansavvy Jul 15, 2024
fd5f7e7
Merge branch 'cansavvy-patch-1' of github.com:jhudsl/ottr_docker into…
cansavvy Jul 15, 2024
9ac6d35
Lol quotes
cansavvy Jul 15, 2024
bfb6d26
More quotes?
cansavvy Jul 15, 2024
45bdb21
Try littler approach
cansavvy Jul 15, 2024
022cfab
Do littler for everything
cansavvy Jul 15, 2024
a0c4714
Update Dockerfile
cansavvy Jul 15, 2024
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
30 changes: 5 additions & 25 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Candace Savonen Apr 2022

name: Build Docker Image
Expand Down Expand Up @@ -30,26 +29,11 @@ jobs:
build-docker:
name: Build Docker image
runs-on: ubuntu-latest


steps:
- name: checkout repo
uses: actions/checkout@v3

- name: Verify Dockerfiles changed?
uses: tj-actions/[email protected]
id: verify-changed-files
with:
files: |
${{ inputs.directory }}/Dockerfile
${{ inputs.directory }}/github_package_list.tsv

- name: Login as jhudsl-robot
run: |
git config --local --add safe.directory "$GITHUB_WORKSPACE"
git config --local user.email "[email protected]"
git config --local user.name "jhudsl-robot"


# Set up Docker build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand All @@ -63,17 +47,13 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-

- name: Set up Docker Build
uses: docker/setup-buildx-action@v1

- name: Build Docker image
uses: docker/build-push-action@v4
- name: Build
uses: docker/build-push-action@v6
with:
push: false
load: true
context: ${{ inputs.directory }}
file: ${{ inputs.directory }}/Dockerfile
tags: ${{ inputs.tag }}
secrets: |
"github_token=${{ secrets.GH_PAT }}"

cansavvy marked this conversation as resolved.
Show resolved Hide resolved
# Login to Dockerhub
- name: Login to DockerHub
Expand Down
6 changes: 3 additions & 3 deletions base_ottr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ RUN Rscript -e "options(warn = 2);install.packages( \
# cow needs this dependency:
RUN Rscript -e "devtools::install_version('gitcreds', version = '0.1.1', repos = 'http://cran.us.r-project.org')"

# Copy over git token and package list
COPY git_token.txt .
# Copy over git token and package
RUN --mount=type=secret,id=GH_PAT
COPY github_package_list.tsv .

# Install packages from github
RUN Rscript install_github.R \
--packages github_package_list.tsv \
--token git_token.txt
--token /run/secrets/GH_PAT

# Set final workdir for commands
WORKDIR /home/rstudio
Expand Down
Loading