Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9798b522bd | |||
| f27eb23804 |
@@ -13,12 +13,12 @@ name: Provision Coder Templates
|
|||||||
# CODER_URL e.g. https://code.octoturge.com
|
# CODER_URL e.g. https://code.octoturge.com
|
||||||
# CODER_SESSION_TOKEN a token from `coder tokens create`, ideally under a
|
# CODER_SESSION_TOKEN a token from `coder tokens create`, ideally under a
|
||||||
# dedicated service account rather than a personal one
|
# dedicated service account rather than a personal one
|
||||||
# GITEA_PACKAGE_TOKEN a Gitea access token (user Settings > Applications)
|
#
|
||||||
# with write:package scope, for pushing each
|
# Pushing each Dockerfile-having template's image to this instance's
|
||||||
# Dockerfile-having template's image to this
|
# container registry uses Gitea's own built-in secrets.GITEA_TOKEN (no
|
||||||
# instance's container registry. Only the octoturge
|
# manually-created PAT needed) - build-images grants it write access via
|
||||||
# account's own token is used - docker login below
|
# `permissions: packages: write` below. See
|
||||||
# hardcodes that username to match.
|
# https://docs.gitea.com/usage/actions/token-permissions/
|
||||||
#
|
#
|
||||||
# Any templates/<env>/ that has its own Dockerfile gets its image built and
|
# Any templates/<env>/ that has its own Dockerfile gets its image built and
|
||||||
# pushed here (build-images, on the dedicated "docker-build" runner - see
|
# pushed here (build-images, on the dedicated "docker-build" runner - see
|
||||||
@@ -49,6 +49,11 @@ jobs:
|
|||||||
# container.volumes mount for the same path here fails at container
|
# container.volumes mount for the same path here fails at container
|
||||||
# creation with "Duplicate mount point: /var/run/docker.sock".
|
# creation with "Duplicate mount point: /var/run/docker.sock".
|
||||||
runs-on: docker-build
|
runs-on: docker-build
|
||||||
|
# The default token permission mode denies package write unless a job
|
||||||
|
# explicitly asks for it - without this, docker push fails with
|
||||||
|
# "unauthorized: reqPackageAccess".
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
outputs:
|
outputs:
|
||||||
failed_templates: ${{ steps.build.outputs.failed_templates }}
|
failed_templates: ${{ steps.build.outputs.failed_templates }}
|
||||||
# docker:27-cli (Alpine) has no bash - only the POSIX /bin/sh (busybox
|
# docker:27-cli (Alpine) has no bash - only the POSIX /bin/sh (busybox
|
||||||
@@ -74,7 +79,7 @@ jobs:
|
|||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
echo "${{ secrets.GITEA_PACKAGE_TOKEN }}" | docker login git.octoturge.com -u octoturge --password-stdin
|
echo "${{ secrets.GITEA_TOKEN }}" | docker login git.octoturge.com -u "${{ github.actor }}" --password-stdin
|
||||||
|
|
||||||
FAILED=""
|
FAILED=""
|
||||||
for dockerfile in templates/*/Dockerfile; do
|
for dockerfile in templates/*/Dockerfile; do
|
||||||
|
|||||||
Reference in New Issue
Block a user