Skip to content

Commit

Permalink
Merge pull request #60 from gboutry/feat/publish-directory
Browse files Browse the repository at this point in the history
Publish directly to ghcr registry
  • Loading branch information
hemanthnakkina authored Jul 2, 2024
2 parents 195f0f7 + 9499efb commit ccd4eaf
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/actions/publish-rock/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ inputs:
runs:
using: composite
steps:
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ inputs.username }}
password: ${{ inputs.password }}
- name: Install skopeo
shell: bash
run: |
Expand All @@ -27,17 +21,25 @@ runs:
- name: Install yq
shell: bash
run: sudo snap install yq
- name: Log in to the Container registry
shell: bash
run: |
skopeo login ghcr.io --username "${{ inputs.username }}"" --password "${{ inputs.password }}"
- name: Import and push to github package
shell: bash
run: |
rock_file="${{ inputs.rock }}"
rockdir=$(dirname $rock_file)
image_name="$(yq '.name' $rockdir/rockcraft.yaml)"
version="$(yq '.version' $rockdir/rockcraft.yaml)"
echo "Publishing rock ${image_name}:${version}"
sudo skopeo \
--insecure-policy \
copy \
oci-archive:"${rock_file}" \
docker-daemon:"ghcr.io/canonical/${image_name}:${version}"
echo "Publishing rock ${image_name}:${version}"
docker push ghcr.io/canonical/${image_name}:${version}
docker://"ghcr.io/canonical/${image_name}:${version}"
- name: Log out of the Container registry
if: always()
shell: bash
run: |
skopeo logout ghcr.io

0 comments on commit ccd4eaf

Please sign in to comment.