This commit is contained in:
parent
a3066be43e
commit
12a4a85510
4 changed files with 33 additions and 26 deletions
|
|
@ -8,6 +8,10 @@ description: Push the `source` image to the `destination` registry
|
||||||
# Parameters
|
# Parameters
|
||||||
#=======================================================================
|
#=======================================================================
|
||||||
inputs:
|
inputs:
|
||||||
|
registry:
|
||||||
|
required: true
|
||||||
|
description: The registry to authen
|
||||||
|
|
||||||
source:
|
source:
|
||||||
required: true
|
required: true
|
||||||
description: The source image to be pushed
|
description: The source image to be pushed
|
||||||
|
|
@ -25,4 +29,10 @@ runs:
|
||||||
- name: Authenticate
|
- name: Authenticate
|
||||||
run: |
|
run: |
|
||||||
echo "Authenticate"
|
echo "Authenticate"
|
||||||
echo "pushing image '${{ inputs.source }}' to '${{ inputs.destination }}'"
|
echo "pushing image '${{ inputs.source }}' to '${{ inputs.destination }}'"
|
||||||
|
|
||||||
|
echo "${{ forge.token }}" | podman login --username '${{ forge.actor }}' --password-stdin
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
run: |
|
||||||
|
podman push '${{ inputs.source }}' '${{ inputs.destination }}'
|
||||||
|
|
@ -35,30 +35,27 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
nix-build src/default.nix
|
nix-build src/default.nix
|
||||||
podman load < result
|
podman load < result
|
||||||
|
|
||||||
|
- name: Log into registry
|
||||||
|
run: |
|
||||||
|
podman login \
|
||||||
|
--log-level=debug \
|
||||||
|
--authfile ~/.config/containers/auth.json \
|
||||||
|
--username "${{ forge.actor }}" \
|
||||||
|
--password "${{ forge.token }}" \
|
||||||
|
${{ env.registry }}
|
||||||
|
|
||||||
- uses: ./.forgejo/actions/push_container
|
curl --fail -u${{ forge.actor }}:${{ forge.token }} -sS ${{ env.registry }}/v2/token | jq --raw-output '"Authorization: token \(.token)"'
|
||||||
with:
|
|
||||||
source: ${{ env.registry }}/${{ env.owner }}/${{ env.image }}:${{ env.tag }}
|
|
||||||
destination: ${{ env.registry }}/${{ env.owner }}/${{ env.image }}:${{ env.tag }}
|
|
||||||
|
|
||||||
# - name: Log into registry
|
- name: __DEBUG__
|
||||||
# run: >-
|
run: |
|
||||||
# podman login
|
echo "~/.config/containers/auth.json"
|
||||||
# --log-level=debug
|
[ -f ~/.config/containers/auth.json ] && cat ~/.config/containers/auth.json || echo "file doesn't exist"
|
||||||
# --authfile ~/.config/containers/auth.json
|
|
||||||
# --username "${{ forge.actor }}"
|
|
||||||
# --password "${{ forge.token }}"
|
|
||||||
# ${{ env.registry }}
|
|
||||||
|
|
||||||
# - name: __DEBUG__
|
- name: Push image
|
||||||
# run: |
|
run: >-
|
||||||
# echo "~/.config/containers/auth.json"
|
podman push
|
||||||
# [ -f ~/.config/containers/auth.json ] && cat ~/.config/containers/auth.json || echo "file doesn't exist"
|
--log-level=debug
|
||||||
|
--authfile ~/.config/containers/auth.json
|
||||||
# - name: Push image
|
localhost/default:latest
|
||||||
# run: >-
|
${{ env.registry }}/${{ env.owner }}/${{ env.image }}:${{ env.tag }}
|
||||||
# podman push
|
|
||||||
# --log-level=debug
|
|
||||||
# --authfile ~/.config/containers/auth.json
|
|
||||||
# localhost/default:latest
|
|
||||||
# ${{ env.registry }}/${{ env.owner }}/${{ env.image }}:${{ env.tag }}
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
dockerTools.buildImage {
|
dockerTools.buildImage {
|
||||||
name = "git.amarth.cloud/default";
|
name = "default";
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
|
|
||||||
copyToRoot = buildEnv {
|
copyToRoot = buildEnv {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue