-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (38 loc) · 1.25 KB
/
linux-build-cli.yml
File metadata and controls
51 lines (38 loc) · 1.25 KB
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
50
51
name: Linux - Build CLI
on:
workflow_dispatch:
pull_request:
env:
DOCKER_REPO_HIVE_CLI: ${{ vars.DOCKER_REPO_HIVE_CLI }}
jobs:
build-linux-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore src/Hive.CLI/
- name: Build
run: dotnet build -c Release --no-restore
build-release-linux-cli-docker-image:
needs: build-linux-cli
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/github-script@v6
id: img-name
with:
script: |
const imageName = process.env.DOCKER_REPO_HIVE_CLI + ':' + context.ref_name + '.' + context.sha
core.setOutput('IMAGE_NAME', imageName)
- name: Build Docker image
run: docker build --file ./src/Hive.CLI/Dockerfile --tag ${{ steps.img-name.outputs.IMAGE_NAME }} .
- name: Push Docker image
run: docker push ${{ steps.img-name.outputs.IMAGE_NAME }}