feat(ci): add GHCR image registry support
This commit is contained in:
1 parent
62ab170b21
commit
078900f81c
2 files changed
+13
-2
No files matched your search
@@ -22,6 +22,10 @@ on:
|
|||||||
description: 'Override platforms (defaults to vars.DOCKER_PLATFORMS or linux/amd64,linux/arm64)'
|
description: 'Override platforms (defaults to vars.DOCKER_PLATFORMS or linux/amd64,linux/arm64)'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
ghcr_image_override:
|
||||||
|
description: 'Override GHCR image name (defaults to vars.GHCR_IMAGE, leave empty to skip GHCR)'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -42,6 +46,8 @@ jobs:
|
|||||||
SNOWLUMA_TAG: ${{ inputs.snowluma_tag }}
|
SNOWLUMA_TAG: ${{ inputs.snowluma_tag }}
|
||||||
IMAGE_OVERRIDE: ${{ inputs.docker_image_override }}
|
IMAGE_OVERRIDE: ${{ inputs.docker_image_override }}
|
||||||
PLATFORMS_OVERRIDE: ${{ inputs.platforms_override }}
|
PLATFORMS_OVERRIDE: ${{ inputs.platforms_override }}
|
||||||
|
GHCR_IMAGE: ${{ vars.GHCR_IMAGE }}
|
||||||
|
GHCR_OVERRIDE: ${{ inputs.ghcr_image_override }}
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.SNOWLUMA_TOKEN }}
|
github-token: ${{ secrets.SNOWLUMA_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
@@ -59,6 +65,7 @@ jobs:
|
|||||||
const platforms = process.env.PLATFORMS_OVERRIDE || process.env.DOCKER_PLATFORMS || 'linux/amd64,linux/arm64';
|
const platforms = process.env.PLATFORMS_OVERRIDE || process.env.DOCKER_PLATFORMS || 'linux/amd64,linux/arm64';
|
||||||
const workflowId = process.env.DOCKER_WORKFLOW || 'docker-image.yml';
|
const workflowId = process.env.DOCKER_WORKFLOW || 'docker-image.yml';
|
||||||
const ref = process.env.DOCKER_REF || 'main';
|
const ref = process.env.DOCKER_REF || 'main';
|
||||||
|
const ghcrImage = process.env.GHCR_OVERRIDE || process.env.GHCR_IMAGE || '';
|
||||||
|
|
||||||
await github.rest.actions.createWorkflowDispatch({
|
await github.rest.actions.createWorkflowDispatch({
|
||||||
owner,
|
owner,
|
||||||
@@ -72,7 +79,8 @@ jobs:
|
|||||||
platforms,
|
platforms,
|
||||||
snowluma_tag: tag,
|
snowluma_tag: tag,
|
||||||
snowluma_repository: sourceRepo,
|
snowluma_repository: sourceRepo,
|
||||||
|
ghcr_image: ghcrImage,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
core.info(`Re-dispatched ${workflowId}@${ref} on ${target} for SnowLuma release ${sourceRepo}@${tag} (image=${image}, platforms=${platforms}).`);
|
core.info(`Re-dispatched ${workflowId}@${ref} on ${target} for SnowLuma release ${sourceRepo}@${tag} (image=${image}, ghcr_image=${ghcrImage}, platforms=${platforms}).`);
|
||||||
@@ -217,6 +217,7 @@ jobs:
|
|||||||
DOCKER_PLATFORMS: ${{ vars.DOCKER_PLATFORMS }}
|
DOCKER_PLATFORMS: ${{ vars.DOCKER_PLATFORMS }}
|
||||||
DOCKER_WORKFLOW: ${{ vars.DOCKER_WORKFLOW }}
|
DOCKER_WORKFLOW: ${{ vars.DOCKER_WORKFLOW }}
|
||||||
DOCKER_REF: ${{ vars.DOCKER_REF }}
|
DOCKER_REF: ${{ vars.DOCKER_REF }}
|
||||||
|
GHCR_IMAGE: ${{ vars.GHCR_IMAGE }}
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.SNOWLUMA_TOKEN }}
|
github-token: ${{ secrets.SNOWLUMA_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
@@ -232,6 +233,7 @@ jobs:
|
|||||||
const platforms = process.env.DOCKER_PLATFORMS || 'linux/amd64,linux/arm64';
|
const platforms = process.env.DOCKER_PLATFORMS || 'linux/amd64,linux/arm64';
|
||||||
const workflowId = process.env.DOCKER_WORKFLOW || 'docker-image.yml';
|
const workflowId = process.env.DOCKER_WORKFLOW || 'docker-image.yml';
|
||||||
const ref = process.env.DOCKER_REF || 'main';
|
const ref = process.env.DOCKER_REF || 'main';
|
||||||
|
const ghcrImage = process.env.GHCR_IMAGE || '';
|
||||||
|
|
||||||
await github.rest.actions.createWorkflowDispatch({
|
await github.rest.actions.createWorkflowDispatch({
|
||||||
owner,
|
owner,
|
||||||
@@ -245,7 +247,8 @@ jobs:
|
|||||||
platforms,
|
platforms,
|
||||||
snowluma_tag: tag,
|
snowluma_tag: tag,
|
||||||
snowluma_repository: sourceRepo,
|
snowluma_repository: sourceRepo,
|
||||||
|
ghcr_image: ghcrImage,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
core.info(`Dispatched ${workflowId}@${ref} on ${target} for SnowLuma release ${sourceRepo}@${tag} (image=${image}, platforms=${platforms}).`);
|
core.info(`Dispatched ${workflowId}@${ref} on ${target} for SnowLuma release ${sourceRepo}@${tag} (image=${image}, ghcr_image=${ghcrImage}, platforms=${platforms}).`);
|
||||||
Reference in new issue
Block a user