Update Gitea workflows to use REGISTRY_USER and REGISTRY_TOKEN for registry login, falling back to GITEA_TOKEN when secrets are unavailable.
This commit is contained in:
1 parent
b9203f74f4
commit
d58101287d
2 files changed
+14
-10
No files matched your search
@@ -1,3 +1,6 @@
|
|||||||
|
# Builds the images and pushes them to the registry of the organization.
|
||||||
|
# Uses the secrets REGISTRY_USER and REGISTRY_TOKEN (a token with package
|
||||||
|
# write access) when they exist, else the automatic token of the run.
|
||||||
name: images
|
name: images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -27,8 +30,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Log in to the registry
|
- name: Log in to the registry
|
||||||
run: >
|
run: >
|
||||||
echo "${{ secrets.GITEA_TOKEN }}"
|
echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}"
|
||||||
| docker login "${REGISTRY%%/*}" -u "${{ gitea.actor }}" --password-stdin
|
| docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
run: |
|
run: |
|
||||||
@@ -44,8 +47,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Log in to the registry
|
- name: Log in to the registry
|
||||||
run: >
|
run: >
|
||||||
echo "${{ secrets.GITEA_TOKEN }}"
|
echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}"
|
||||||
| docker login "${REGISTRY%%/*}" -u "${{ gitea.actor }}" --password-stdin
|
| docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
run: |
|
run: |
|
||||||
@@ -61,8 +64,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Log in to the registry
|
- name: Log in to the registry
|
||||||
run: >
|
run: >
|
||||||
echo "${{ secrets.GITEA_TOKEN }}"
|
echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}"
|
||||||
| docker login "${REGISTRY%%/*}" -u "${{ gitea.actor }}" --password-stdin
|
| docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
run: |
|
run: |
|
||||||
@@ -78,8 +81,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Log in to the registry
|
- name: Log in to the registry
|
||||||
run: >
|
run: >
|
||||||
echo "${{ secrets.GITEA_TOKEN }}"
|
echo "${{ secrets.REGISTRY_TOKEN || secrets.GITEA_TOKEN }}"
|
||||||
| docker login "${REGISTRY%%/*}" -u "${{ gitea.actor }}" --password-stdin
|
| docker login "${REGISTRY%%/*}" -u "${{ secrets.REGISTRY_USER || gitea.actor }}" --password-stdin
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -185,8 +185,9 @@ corepack pnpm test
|
|||||||
Node runs the TypeScript sources directly. Gitea Actions checks every push
|
Node runs the TypeScript sources directly. Gitea Actions checks every push
|
||||||
to `develop` and `master` and builds the images `homepage-sandbox`,
|
to `develop` and `master` and builds the images `homepage-sandbox`,
|
||||||
`homepage-spawner`, `homepage-backend` and `homepage-jobs`, tagged with the
|
`homepage-spawner`, `homepage-backend` and `homepage-jobs`, tagged with the
|
||||||
commit and the branch. It logs in to the registry with the automatic token
|
commit and the branch. It logs in to the registry with the secrets
|
||||||
of each run, so it needs no secrets.
|
`REGISTRY_USER` and `REGISTRY_TOKEN` (a token with package write access)
|
||||||
|
when they exist, and otherwise with the automatic token of the run.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user