-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | docker-gear release version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_version: | ||
description: 'Release version from https://get.gear.rs Example: v1.0.0. *Null = latest' | ||
required: false | ||
default: '' | ||
|
||
env: | ||
RELEASE_VERSION: ${{ github.event.inputs.release_version }} | ||
|
||
jobs: | ||
build: | ||
runs-on: [kuberunner] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-gear-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-gear | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- run: | | ||
if [ -z "${{ env.RELEASE_VERSION }}" ]; then | ||
echo "DOCKER_TAGS=ghcr.io/gear-tech/node:latest" >> $GITHUB_ENV | ||
else | ||
echo "DOCKER_TAGS=ghcr.io/gear-tech/node:latest,ghcr.io/gear-tech/node:${{ env.RELEASE_VERSION }}" >> $GITHUB_ENV | ||
fi | ||
- uses: docker/build-push-action@v4 | ||
with: | ||
file: ./gear-CI/Dockerfile-release | ||
push: true | ||
tags: ${{ env.DOCKER_TAGS }} | ||
build-args: | | ||
RELEASE_VERSION=${{ env.RELEASE_VERSION }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM debian:12-slim | ||
|
||
ARG RELEASE_VERSION | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl sudo xz-utils && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN if [ -z "$RELEASE_VERSION" ]; then \ | ||
curl --proto '=https' --tlsv1.2 -sSf https://get.gear.rs/install.sh | bash -s -- --to /usr/local/bin/ ; \ | ||
else \ | ||
curl --proto '=https' --tlsv1.2 -sSf https://get.gear.rs/install.sh | bash -s -- --tag ${RELEASE_VERSION} --to /usr/local/bin/ ; \ | ||
fi | ||
|
||
RUN gear --version | ||
|
||
CMD ["gear"] |