forked from openstack-snaps/ubuntu-openstack-rocks
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from gboutry/feat/publish-directory
Publish directly to ghcr registry
- Loading branch information
Showing
1 changed file
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
@@ -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 |