mirror of
https://github.com/cupcakearmy/docker-static.git
synced 2024-12-22 00:06:31 +00:00
try multiple tags
This commit is contained in:
parent
574c2b7b87
commit
06ca83bb58
33
.github/workflows/trial.yml
vendored
33
.github/workflows/trial.yml
vendored
@ -37,16 +37,35 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
with:
|
with:
|
||||||
install: true
|
install: true
|
||||||
# - name: Login to DockerHub
|
|
||||||
# uses: docker/login-action@v1
|
- name: Log in to Docker Hub
|
||||||
# with:
|
uses: docker/login-action@v2
|
||||||
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
with:
|
||||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
- name: Log in to the Container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Docker Labels
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
cupcakearmy/breitbandbot
|
||||||
|
ghcr.io/${{ github.repository }}
|
||||||
|
tags: ${{ matrix.tags }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64
|
# platforms: linux/amd64,linux/arm64
|
||||||
|
platforms: linux/amd64
|
||||||
push: false
|
push: false
|
||||||
build-args: NGINX=${{ matrix.version }}
|
build-args: NGINX=${{ matrix.version }}
|
||||||
tags: cupcakearmy/static:${{ matrix.tag }},ghcr.io/${{ github.repository }}:${{ matrix.tag }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
# tags: cupcakearmy/static:${{ matrix.tag }},ghcr.io/${{ github.repository }}:${{ matrix.tag }}
|
||||||
|
@ -18,17 +18,20 @@ const versions = matches.map(clean)
|
|||||||
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
|
// Map the docker tags to the versions
|
||||||
const tagsMap = Object.fromEntries(filtered.map((v) => [v, v]))
|
// const tagsMap = Object.fromEntries(filtered.map((v) => [v, v]))
|
||||||
|
|
||||||
// Add the mainline, stable and latests tags
|
// Add the mainline, stable and latests tags
|
||||||
tagsMap['latest'] = versions[0]
|
// tagsMap['latest'] = versions[0]
|
||||||
tagsMap['mainline'] = versions[0]
|
// tagsMap['mainline'] = versions[0]
|
||||||
tagsMap['stable'] = versions[1]
|
// 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: Object.entries(tagsMap).map(([tag, version]) => ({ tag, version })),
|
include: [
|
||||||
|
{ 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