Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): add gha for manual update docker #280

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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