-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-pipeline.yml
42 lines (39 loc) · 1.65 KB
/
build-pipeline.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
# Based on https://github.com/khulnasoft/ml-buildkit/blob/v0.6.18/workflows/build-pipeline.yml
name: build-pipeline
on:
workflow_dispatch:
inputs:
build_args:
description: "Arguments passed to build script"
required: false
working_directory:
description: "Working directory from where the build command is run"
required: false
push:
pull_request:
env:
BUILD_ARGS: ${{ secrets.BUILD_ARGS }}
WORKING_DIRECTORY: ${{ secrets.WORKING_DIRECTORY }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: set-input-build-args
if: ${{ github.event.inputs != null && github.event.inputs.build_args != null}}
run: echo "BUILD_ARGS=${{ github.event.inputs.build_args }}" >> $GITHUB_ENV
# new syntax: run: echo "BUILD_ARGS=${{ github.event.inputs.build_args }}" >> "$GITHUB_ENV"
- name: set-input-working-directory
if: ${{ github.event.inputs != null && github.event.inputs.working_directory != null}}
run: echo "WORKING_DIRECTORY=${{ github.event.inputs.working_directory }}" >> $GITHUB_ENV
# new syntax: run: echo "WORKING_DIRECTORY=${{ github.event.inputs.working_directory }}" >> "$GITHUB_ENV"
# Set host ip to env variable to be uside within container actions
- name: set-host-ip
run: echo "_HOST_IP=$(hostname -I | cut -d ' ' -f 1)" >> $GITHUB_ENV
- uses: actions/checkout@v2
- name: run-build-scripts
uses: ./.github/actions/build-environment
with:
build_args: ${{ env.BUILD_ARGS }}
working_directory: ${{ env.WORKING_DIRECTORY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}