From 6d5afd24920e1b5aa49e7b12d75f45217aefd67b Mon Sep 17 00:00:00 2001 From: arnfinn Date: Tue, 31 Oct 2023 11:03:50 +0100 Subject: [PATCH 1/3] Aktiver bygging av docker image gjennom github actions Closes #15 --- .github/workflows/docker.yml | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..0583199 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,60 @@ +name: Publish Docker image +on: + release: + types: [published] + push: + branches: + - main + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + push_to_registries: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + config: + - {name: imongr} + name: Image shinyproxy-${{ matrix.config.name }} + steps: + - name: Check out the repo + uses: actions/checkout@v4.1.1 + - name: Lint Dockerfile + uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: "${{ matrix.config.name }}/Dockerfile" + - name: Prepare tags + id: docker_meta + uses: docker/metadata-action@v5.0.0 + with: + images: hnskde/shinyproxy-${{ matrix.config.name }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.0.0 + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3.0.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push to Docker Hub + uses: docker/build-push-action@v5.0.0 + with: + context: . + file: ./${{ matrix.config.name }}/Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.docker_meta.outputs.tags }} + labels: ${{ steps.docker_meta.outputs.labels }} + build-args: GH_PAT=${{ secrets.GITHUB_TOKEN }} + cache-from: type=gha + cache-to: type=gha,mode=max From bcda499fe0fba591e8aa0430b4be563b3f5b87b8 Mon Sep 17 00:00:00 2001 From: arnfinn Date: Tue, 31 Oct 2023 11:09:25 +0100 Subject: [PATCH 2/3] lint-fiks --- imongr/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imongr/Dockerfile b/imongr/Dockerfile index cb050a1..7150328 100644 --- a/imongr/Dockerfile +++ b/imongr/Dockerfile @@ -1,7 +1,7 @@ FROM openjdk:8-jre -RUN mkdir -p /opt/shinyproxy/ -RUN wget https://www.shinyproxy.io/downloads/shinyproxy-2.6.1.jar -O /opt/shinyproxy/shinyproxy.jar +RUN mkdir -p /opt/shinyproxy/ \ + && wget --progress=dot:giga https://www.shinyproxy.io/downloads/shinyproxy-2.6.1.jar -O /opt/shinyproxy/shinyproxy.jar COPY application.yml /opt/shinyproxy/application.yml ADD https://raw.githubusercontent.com/mong/imongr/main/pkgdown/favicon/favicon.ico /opt/shinyproxy/ From 5017ab8b7a0029cc6416439a560d097fede5c460 Mon Sep 17 00:00:00 2001 From: arnfinn Date: Tue, 31 Oct 2023 11:13:42 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Endret=20context=20slik=20at=20docker=20f?= =?UTF-8?q?=C3=A5r=20tak=20i=20filer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0583199..cc87a0c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -50,7 +50,7 @@ jobs: - name: Build and push to Docker Hub uses: docker/build-push-action@v5.0.0 with: - context: . + context: ./${{ matrix.config.name }} file: ./${{ matrix.config.name }}/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.docker_meta.outputs.tags }}