Skip to content

Commit

Permalink
revert to docker/build-push-action@v1 but enable ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed Oct 12, 2023
1 parent 78f4611 commit dfd98df
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 44 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/rworkflows_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ jobs:
- os: ubuntu-latest
r: devel
bioc: devel
cont:
image: ghcr.io/bioconductor/bioconductor_docker:devel
volumes:
- /usr/local/bin/docker:/usr/bin/docker
- /var/run/docker.sock:/var/run/docker.sock

cont: ghcr.io/bioconductor/bioconductor_docker:devel
rspm: https://packagemanager.rstudio.com/cran/__linux__/latest/release
- os: macOS-latest
r: latest
Expand Down
70 changes: 32 additions & 38 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -481,53 +481,47 @@ runs:
name: ${{ runner.os }}-biocversion-${{ matrix.config.bioc }}-r-${{ matrix.config.r }}-results
path: check

#### Docker registry steps ####
# - name: πŸ³πŸ›  Set up Docker Buildx
# if: |
# (!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux'
# uses: docker/setup-buildx-action@v2

# - name: πŸ³πŸ›  Set up QEMU
# if: |
# (!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux'
# uses: docker/setup-qemu-action@v3

- name: πŸ³πŸ” Log in to the Github Container registry - ghcr.io
if : |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux' && inputs.docker_registry == 'ghcr.io'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ inputs.GITHUB_TOKEN }}

- name: πŸ³πŸ” Log in to the Github Container registry - docker.io
if: |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux' && inputs.docker_registry == 'docker.io'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ inputs.docker_user }}
password: ${{ inputs.DOCKER_TOKEN }}

## DockerHub steps
- name: 🐳✏️ Create Docker file
if: |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux'
(!contains(github.event.head_commit.message, '/nodocker')) && inputs.run_docker == 'true' && runner.os == 'Linux'
run: |
options(crayon.enabled = TRUE)
if(!require("rworkflows", quietly=TRUE)) remotes::install_github("neurogenomics/rworkflows")
path <- rworkflows::use_dockerfile()
shell: Rscript {0}

- name: πŸ³πŸš€ Build and push to Docker registry
- name: πŸ³πŸš€ Build and push to GHCR
if: |
(!contains(github.event.head_commit.message, '[nodocker]')) && inputs.run_docker == 'true' && runner.os == 'Linux'
uses: docker/build-push-action@v5
with:
push: true
(!contains(github.event.head_commit.message, '/nodocker')) && inputs.run_docker == 'true' && runner.os == 'Linux' && inputs.docker_registry == 'ghcr.io'
uses: docker/build-push-action@v1
with:
username: ${{ github.repository_owner }}
password: ${{ env.GITHUB_TOKEN }}
registry: ${{ inputs.docker_registry }}
repository: ${{ github.repository_owner }}/${{ github.repository }}
tag_with_ref: true
tag_with_sha: false
tags: |
${{ env.packageVersion }},
latest
build_args: |
PKG=${{ env.packageNameOrig }},
CONT=${{ matrix.config.cont }}
- name: πŸ³πŸš€ Build and push to DockerHub
if: |
(!contains(github.event.head_commit.message, '/nodocker')) && inputs.run_docker == 'true' && runner.os == 'Linux' && inputs.docker_registry == 'docker.io'
uses: docker/build-push-action@v1
with:
username: ${{ inputs.docker_user }}
password: ${{ inputs.DOCKER_TOKEN }}
repository: ${{ inputs.docker_org }}/${{ env.packageName }}
tag_with_ref: true
tag_with_sha: false
tags: |
${{ inputs.docker_registry }}/${{ inputs.docker_org }}/${{ env.packageName }}:${{ env.packageVersion }},
${{ inputs.docker_registry }}/${{ inputs.docker_org }}/${{ env.packageName }}:latest
${{ env.packageVersion }},
latest
build_args: |
PKG=${{ env.packageNameOrig }},
BASE_IMAGE=${{ matrix.config.cont }}
CONT=${{ matrix.config.cont }}

0 comments on commit dfd98df

Please sign in to comment.