mirror of
https://github.com/cupcakearmy/docker-static.git
synced 2024-12-22 00:06:31 +00:00
separate with ;
This commit is contained in:
parent
06ca83bb58
commit
2b84c86d45
1
.github/workflows/trial.yml
vendored
1
.github/workflows/trial.yml
vendored
@ -58,6 +58,7 @@ jobs:
|
|||||||
cupcakearmy/breitbandbot
|
cupcakearmy/breitbandbot
|
||||||
ghcr.io/${{ github.repository }}
|
ghcr.io/${{ github.repository }}
|
||||||
tags: ${{ matrix.tags }}
|
tags: ${{ matrix.tags }}
|
||||||
|
sep-tags: ";"
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
|
@ -10,28 +10,27 @@ const re = /"\/download\/nginx-(\d+\.){3}tar\.gz"/g
|
|||||||
const matches = html.match(re)
|
const matches = html.match(re)
|
||||||
|
|
||||||
// Clean up the matches to semver format
|
// Clean up the matches to semver format
|
||||||
const clean = (match) => match.replace(/"/g, '').replace('/download/nginx-', '').replace('.tar.gz', '')
|
function clean(match) {
|
||||||
|
return match.replace(/"/g, '').replace('/download/nginx-', '').replace('.tar.gz', '')
|
||||||
|
}
|
||||||
const versions = matches.map(clean)
|
const versions = matches.map(clean)
|
||||||
|
|
||||||
// Filter
|
// Filter
|
||||||
// Get the two most up to date versions, mainline and stable
|
// Get the two most up to date versions, mainline and stable
|
||||||
const filtered = versions.sort(semver.rcompare).slice(0, 2)
|
const filtered = versions.sort(semver.rcompare).slice(0, 2)
|
||||||
|
|
||||||
// Map the docker tags to the versions
|
// Set the tags with a delimiter of ";"
|
||||||
// const tagsMap = Object.fromEntries(filtered.map((v) => [v, v]))
|
function convert(version, additional = []) {
|
||||||
|
return {
|
||||||
// Add the mainline, stable and latests tags
|
version,
|
||||||
// tagsMap['latest'] = versions[0]
|
tags: [version, ...additional].join(';'),
|
||||||
// tagsMap['mainline'] = versions[0]
|
}
|
||||||
// tagsMap['stable'] = versions[1]
|
}
|
||||||
|
|
||||||
// Export as github action matrix
|
// Export as github action matrix
|
||||||
// https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
|
// https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
|
||||||
const githubActionMatrix = {
|
const githubActionMatrix = {
|
||||||
include: [
|
include: [convert(versions[0], ['latest', 'mainline']), convert(versions[1], ['stable'])],
|
||||||
{ version: filtered[0], tags: ['latest', 'mainline', filtered[0]] },
|
|
||||||
{ version: filtered[1], tags: ['stable', filtered[1]] },
|
|
||||||
],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const serialised = JSON.stringify(githubActionMatrix)
|
const serialised = JSON.stringify(githubActionMatrix)
|
||||||
|
Loading…
Reference in New Issue
Block a user