-
Notifications
You must be signed in to change notification settings - Fork 12
84 lines (73 loc) · 2.8 KB
/
develop.yaml
File metadata and controls
84 lines (73 loc) · 2.8 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Orb Agent - develop
on:
workflow_dispatch:
inputs:
docker_tag:
description: 'Docker tag to use for the image'
required: false
default: 'develop'
type: string
push:
branches: [ develop ]
paths:
- "agent/**"
- "cmd/**"
- "!agent/docker/**"
permissions:
contents: write
id-token: write
env:
GO_VERSION: '1.25'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 #v3.4.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca #v3.9.0
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 #v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup JFrog CLI
id: setup-jfrog-cli
uses: jfrog/setup-jfrog-cli@ff5cb544114ffc152db9cea1cd3d5978d5074946 # v4.5.11
env:
JF_URL: https://netboxlabs.jfrog.io
JF_PROJECT: obs
with:
oidc-provider-name: github-ci
- name: Login to JFrog Artifactory
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 #v3
with:
registry: netboxlabs.jfrog.io
username: ${{ steps.setup-jfrog-cli.outputs.oidc-user }}
password: ${{ steps.setup-jfrog-cli.outputs.oidc-token }}
- name: Verify QEMU installation
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm --platform linux/arm64 debian:latest uname -m
- name: Set build info
run: |
echo ${GITHUB_SHA::7} > ./agent/version/BUILD_COMMIT.txt
LATEST_RELEASE=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r '.tag_name')
echo $LATEST_RELEASE > ./agent/version/BUILD_VERSION.txt
- name: Build image and push
uses: docker/build-push-action@0adf9959216b96bec444f325f1e493d4aa344497 #v6.14.0
with:
context: .
file: agent/docker/Dockerfile
platforms: linux/amd64, linux/arm64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
no-cache-filters: python-builder
tags: |
netboxlabs/orb-agent:${{ github.event.inputs.docker_tag || 'develop' }}
netboxlabs.jfrog.io/obs-builds/orb-agent:${{ github.event.inputs.docker_tag || 'develop' }}
build-args: |
GO_VERSION=${{ env.GO_VERSION }}