Skip to content

Commit

Permalink
feat: multiarch oci image
Browse files Browse the repository at this point in the history
  • Loading branch information
kayra1 committed Oct 2, 2024
1 parent b8cb5d4 commit 5afccda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/build-rock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,5 @@ jobs:
build-rock:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: canonical/craft-actions/rockcraft-pack@main
id: rockcraft
- uses: actions/upload-artifact@v4
with:
name: rock
path: ${{ steps.rockcraft.outputs.rock }}
- name: Build rock
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
37 changes: 7 additions & 30 deletions .github/workflows/publish-rock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,10 @@ jobs:
publish-rock:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install rockcraft
run: |
sudo snap install rockcraft --classic --channel edge
- uses: actions/download-artifact@v4
with:
name: rock

- name: Import and push to github package
run: |
image_name="$(yq '.name' rockcraft.yaml)"
version="$(yq '.version' rockcraft.yaml)"
rock_file=$(ls *.rock | tail -n 1)
sudo rockcraft.skopeo \
--insecure-policy \
copy \
oci-archive:"${rock_file}" \
docker-daemon:"ghcr.io/canonical/${image_name}:${version}"
docker tag ghcr.io/canonical/${image_name}:${version} ghcr.io/canonical/${image_name}:latest
docker push ghcr.io/canonical/${image_name}:${version}
docker push ghcr.io/canonical/${image_name}:latest
- name: Publish rock
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
artifact-prefix: ${{ needs.go-build.outputs.artifact-prefix }}
permissions:
packages: write
contents: write

0 comments on commit 5afccda

Please sign in to comment.