Skip to content

Commit

Permalink
Github action for docker image deploy (#8)
Browse files Browse the repository at this point in the history
* Github action for docker image deploy

Dytter opp code-server-image til dockerhub ved commits til main og ved ny release

* hadolint fix
  • Loading branch information
arnfinn authored Sep 7, 2023
1 parent d5f7438 commit dfee666
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Docker image
on:
release:
types: [published]
push:
branches:
- main
pull_request:
branches:
- main

jobs:
push_to_registries:
name: Push Docker image to docker hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3.6.0
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: "code-server/Dockerfile"
- name: Prepare tags
id: docker_meta
uses: docker/metadata-action@v4.6.0
with:
images: hnskde/imongr
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.10.0
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v4.1.1
with:
context: .
file: ./code-server/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
2 changes: 1 addition & 1 deletion code-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ RUN touch /home/coder/.Renviron \
&& R -e "install.packages(c('remotes', 'devtools', 'tinytex', 'languageserver'), lib = '/home/coder/R/library')" \
&& R -e "remotes::install_github('Rapporteket/rapbase@*release', lib = '/home/coder/R/library')" \
&& R -e "tinytex::install_tinytex()" \
&& export PATH=~/bin:$PATH \
&& export PATH="$HOME/bin:$PATH" \
&& tlmgr update --self --all \
&& tlmgr install \
amsmath \
Expand Down

0 comments on commit dfee666

Please sign in to comment.