build-pipeline #1
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
# Based on https://github.com/ml-tooling/universal-build/blob/v0.6.6/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 | |
# Do not auto-build on commit: push: | |
env: | |
BUILD_ARGS: ${{ secrets.BUILD_ARGS }} | |
WORKING_DIRECTORY: ${{ secrets.WORKING_DIRECTORY }} | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true # TODO: only needed until act supports the new way | |
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 "::set-env name=BUILD_ARGS::${{ github.event.inputs.build_args }}" | |
# 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 "::set-env name=WORKING_DIRECTORY::${{ github.event.inputs.working_directory }}" | |
# 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 "::set-env name=_HOST_IP::$(hostname -I | cut -d ' ' -f 1)" | |
- 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 }} |