From 79d41ac9e57b7e8248cdfc472a6f4338167e3354 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Fri, 14 May 2021 19:12:34 +0100 Subject: [PATCH] refactor: extract archtectures to yml Opens the door to running the same matrix across multiple jobs. PR: #41 --- .github/workflows/containers.yml | 22 +++++++++++++++++++--- architectures.yml | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 architectures.yml diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 3c4a738..7189484 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -13,13 +13,29 @@ on: concurrency: ${{ github.workflow }} jobs: + architectures: + runs-on: ubuntu-latest + outputs: + json: ${{ steps.import.outputs.json }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Import from architectures.yml + id: import + shell: python + run: | + import yaml, json + with open('architectures.yml', 'r') as file: + architectures = yaml.safe_load(file) + print('::set-output name=json::' + json.dumps(architectures)) docker: + needs: + - architectures runs-on: ubuntu-latest strategy: max-parallel: 1 # takes advantage of caching between jobs - matrix: - architecture: - - arm + matrix: + architecture: ${{ fromJSON(needs.architectures.outputs.json) }} target: # ordered from biggest to smallest to take advantage of the registry cache - dev - build diff --git a/architectures.yml b/architectures.yml new file mode 100644 index 0000000..5a762bd --- /dev/null +++ b/architectures.yml @@ -0,0 +1 @@ +- arm \ No newline at end of file