From c57c74a91368ff43026aa87012fdf7ecf8391471 Mon Sep 17 00:00:00 2001 From: Eric Hammy <6815729+condnsdmatters@users.noreply.github.com> Date: Sun, 20 Nov 2022 23:04:27 +0000 Subject: [PATCH] Update GH actions. (#345) Ensure we build and test the deployment of the docker images. --- .github/workflows/build_docker.yml | 31 +++++++++++++++--------------- docker/Dockerfile-bionic | 1 + docker/Dockerfile-focal | 3 ++- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index 3bc7187da..6a0fcb548 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -2,8 +2,6 @@ name: Build & deploy Docker images on: - schedule: - - cron: "0 6,18 * * *" push: paths: - "docker/Dockerfile*" @@ -18,20 +16,22 @@ jobs: matrix: distro: ["xenial", "bionic", "focal"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: - submodules: true - - name: ${{ format('Build {0} image (& Publish - Release Only)', matrix.distro) }} - uses: docker/build-push-action@v1 + submodules: 'recursive' + - name: Docker login + uses: docker/login-action@v2 with: username: edran password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: ${{ format('fairnle/nle-{0}', matrix.distro) }} - dockerfile: ${{ format('docker/Dockerfile-{0}', matrix.distro) }} - tags: dev + - name: ${{ format('Build & Publish `dev` {0} image', matrix.distro) }} + uses: docker/build-push-action@v2 + with: + file: ${{ format('docker/Dockerfile-{0}', matrix.distro) }} + tags: ${{ format('fairnle/nle-{0}', matrix.distro) }}:latest tag_with_sha: true add_git_labels: true - push: ${{ github.ref == 'main' || ( github.event_name == 'release' && github.even.action == 'released' ) }} + push: false # Build on PR only. - name: Check Version Matches Release Tag (Release Only) if: github.event_name == 'release' && github.event.action == 'released' run: | @@ -40,12 +40,11 @@ jobs: [[ "${{ github.event.release.tag_name }}" == "v$(cat version.txt)" ]] - name: Push Version Tag (Release Only) if: github.event_name == 'release' && github.event.action == 'released' - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v2 with: - username: edran - password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: ${{ format('fairnle/nle-{0}', matrix.distro) }} - dockerfile: ${{ format('docker/Dockerfile-{0}', matrix.distro) }} - tags: ${{ github.event.release.tag_name }},latest + file: ${{ format('docker/Dockerfile-{0}', matrix.distro) }} + tags: | + ${{ format('fairnle/nle-{0}', matrix.distro) }}:latest, + ${{ format('fairnle/nle-{0}', matrix.distro) }}:${{ github.event.release.tag_name }} add_git_labels: true push: true diff --git a/docker/Dockerfile-bionic b/docker/Dockerfile-bionic index d0e1cb9dd..83146a91a 100644 --- a/docker/Dockerfile-bionic +++ b/docker/Dockerfile-bionic @@ -4,6 +4,7 @@ FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 ARG PYTHON_VERSION=3.8 ENV DEBIAN_FRONTEND=noninteractive +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub RUN apt-get update && apt-get install -yq \ bison \ diff --git a/docker/Dockerfile-focal b/docker/Dockerfile-focal index adbd68611..05dd0031e 100644 --- a/docker/Dockerfile-focal +++ b/docker/Dockerfile-focal @@ -1,9 +1,10 @@ # -*- mode: dockerfile -*- -FROM nvidia/cuda:11.0-devel-ubuntu20.04 +FROM nvidia/cuda:11.4.3-devel-ubuntu20.04 ARG PYTHON_VERSION=3.8 ENV DEBIAN_FRONTEND=noninteractive +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub RUN apt-get update && apt-get install -yq \ bison \