Generate Action #4
Workflow file for this run
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
name: Generate Action | |
on: | |
workflow_dispatch: | |
inputs: | |
liquibase-version: | |
description: 'Liquibase version' | |
required: true | |
default: '4.26.0' | |
jobs: | |
create-command-list: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build liquibase-protobuf-generator | |
run: docker build -t liquibase-protobuf-generator:${{ inputs.liquibase-version }} . --build-arg VERSION=${{ inputs.liquibase-version }} | |
- name: Generate liquibase command list | |
run: docker run --rm -v $(pwd):/proto liquibase-protobuf-generator:${{ inputs.liquibase-version }} --output-file=commands.json list-commands | |
- name: Read commands from JSON file | |
id: read_commands | |
run: | | |
COMMANDS=$(cat commands.json | jq -r '.[]') | |
echo "COMMANDS=$COMMANDS" >> $GITHUB_ENV | |
- name: Iterate over commands and execute Docker command | |
run: | | |
IFS=$'\n' | |
for command in $COMMANDS; do | |
docker run --rm -v $(pwd):/proto liquibase-protobuf-generator:${{ inputs.liquibase-version }} generate-protobuf --target-command="$command" --output-dir /proto | |
done | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: commands-${{ inputs.liquibase-version }} | |
path: '*.proto' |