-
Notifications
You must be signed in to change notification settings - Fork 105
49 lines (42 loc) · 1.43 KB
/
CI-docker-gear.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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@v3
- uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-gear-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-gear
- uses: docker/login-action@v3
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@v5
with:
file: ./docker/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