Skip to content

Commit

Permalink
Merge pull request #280 from danger/prepare-1.3.1
Browse files Browse the repository at this point in the history
feat(docker): add gha for manual update docker
  • Loading branch information
Vacxe authored Apr 24, 2024
2 parents fb1d13d + 9b89799 commit ca1072b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/docker_manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release distribution

on:
workflow_dispatch :
inputs:
docker-version:
description: "Docker Version"
danger-js-version:
description: "Danger JS release version"
default: "11.3.1"
danger-kotlin-version:
description: "Danger Kotlin release version"
kotlin-version:
description: "Kotlin Version"
default: "1.7.22"

jobs:
docker-build-push:
name: Build and Push Docker image
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Docker Login
run: echo $PACKAGES_WRITE_TOKEN | docker login ghcr.io -u $USERNAME --password-stdin
env:
PACKAGES_WRITE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.actor }}

- name: Docker Build
run: docker build -t ghcr.io/danger/danger-kotlin:$VERSION --build-arg="KOTLINC_VERSION=$KOTLINC_VERSION" --build-arg="DANGER_KOTLIN_VERSION=$DANGER_KOTLIN_VERSION" --build-arg="DANGER_JS_VERSION=$DANGER_JS_VERSION" .
env:
VERSION: ${{ github.event.inputs.docker-version }}
KOTLINC_VERSION: ${{ github.event.inputs.kotlin-version }}
DANGER_KOTLIN_VERSION: ${{ github.event.inputs.danger-kotlin-version }}
DANGER_JS_VERSION: ${{ github.event.inputs.danger-js-version }}

- name: Deploy
run: docker push ghcr.io/danger/danger-kotlin:$VERSION
env:
VERSION: ${{ github.event.inputs.docker-version }}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ LABEL "com.github.actions.color"="blue"

ARG KOTLINC_VERSION="1.7.22"
ARG DANGER_KOTLIN_VERSION="1.3.1"
ARG DANGER_JS_VERSION="11.3.1"

# Install dependencies
RUN apt-get update
Expand All @@ -21,7 +22,7 @@ RUN wget -q "https://github.com/JetBrains/kotlin/releases/download/v$KOTLINC_VER
ENV PATH $PATH:/usr/lib/kotlinc/bin

# Install Danger-JS
RUN npm install -g danger
RUN npm install -g "danger@$DANGER_JS_VERSION
# Install Danger-Kotlin
RUN wget -q "https://github.com/danger/kotlin/releases/download/$DANGER_KOTLIN_VERSION/danger-kotlin-linuxX64.tar" && \
Expand Down

0 comments on commit ca1072b

Please sign in to comment.