From be1f93b0288fc0d12ccc28d5aa2464b386cb9c4c Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Tue, 1 Nov 2022 22:09:24 +0100 Subject: [PATCH] enable cron job --- .github/workflows/{trial.yml => cron.yml} | 12 +++--------- tags/index.js | 5 ++--- 2 files changed, 5 insertions(+), 12 deletions(-) rename .github/workflows/{trial.yml => cron.yml} (87%) diff --git a/.github/workflows/trial.yml b/.github/workflows/cron.yml similarity index 87% rename from .github/workflows/trial.yml rename to .github/workflows/cron.yml index 4a8c8b8..ad3e667 100644 --- a/.github/workflows/trial.yml +++ b/.github/workflows/cron.yml @@ -1,13 +1,9 @@ -name: trial +name: Matrix Cron Build on: workflow_dispatch: - push: - # schedule: - # - cron: "0 3 * * 1" - # push: - # tags: - # - "v*.*.*" + schedule: + - cron: "0 3 * * 1" jobs: tags: @@ -60,7 +56,6 @@ jobs: cupcakearmy/static ghcr.io/${{ github.repository }} tags: ${{ matrix.tags }} - # sep-tags: "," - name: Build and push id: docker_build @@ -71,4 +66,3 @@ jobs: push: false build-args: NGINX=${{ matrix.version }} tags: ${{ steps.meta.outputs.tags }} - # tags: cupcakearmy/static:${{ matrix.tag }},ghcr.io/${{ github.repository }}:${{ matrix.tag }} diff --git a/tags/index.js b/tags/index.js index 48c6fc9..5dcd2be 100644 --- a/tags/index.js +++ b/tags/index.js @@ -19,19 +19,18 @@ const versions = matches.map(clean) // Get the two most up to date versions, mainline and stable const filtered = versions.sort(semver.rcompare).slice(0, 2) -// Set the tags with a delimiter of ";" function convert(version, additional = []) { return { version, // https://github.com/docker/metadata-action#typeraw - tags: [version, ...additional].join('\n'), + tags: [version, ...additional].map((t) => `type=raw,value=${t}`).join('\n'), } } // Export as github action matrix // https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations const githubActionMatrix = { - include: [convert(versions[0], ['latest', 'mainline']), convert(versions[1], ['stable'])], + include: [convert(filtered[0], ['latest', 'mainline']), convert(filtered[1], ['stable'])], } const serialised = JSON.stringify(githubActionMatrix)