Skip to content

Commit

Permalink
import
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyanesh Mishra authored and Gyanesh Mishra committed Dec 2, 2023
1 parent e0265d7 commit 07bd48f
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions .github/workflows/build-soci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}

- name: Set output
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

# - name: Build Docker image
# uses: docker/build-push-action@v2
Expand All @@ -81,30 +85,37 @@ jobs:
- name: Import image in containerd
env:
tags: ${{ steps.meta.outputs.tags }}
short_sha: ${{ steps.vars.outputs.sha_short }}
run: |
echo $tags
echo $short_sha
for tag in $tags
do
echo $tag
# sudo ctr i import --base-name $tag --digests /tmp/lorax-${{ steps.meta.outputs.version }}.tar
echo "Importing $tag into containerd"
sudo ctr i import --base-name $tag --digests /tmp/lorax-${{ steps.meta.outputs.version }}.tar
done
# rm -rf /tmp/lorax-${{ steps.meta.outputs.version }}.tar
# - name: Push image with containerd
# env:
# tags: ${{ steps.meta.outputs.tags }}
# run: |
# for tag in $tags
# do
# sudo ctr i push --user "${{ github.repository_owner }}:${{ secrets.GHCR_PAT }}" $tag
# done
- name: Push image with containerd
env:
tags: ${{ steps.meta.outputs.tags }}
short_sha: ${{ steps.vars.outputs.sha_short }}
run: |
for tag in $tags
do
echo "Pushing $tag to GHCR"
sudo ctr i push --user "${{ github.repository_owner }}:${{ secrets.GHCR_PAT }}" $tag
done
# - name: Create and push soci index
# env:
# tags: ${{ steps.meta.outputs.tags }}
# run: |
# for tag in $tags
# do
# sudo soci create $tag
# sudo soci push --user ${{ github.repository_owner }}:${{ secrets.GHCR_PAT }} $tag
# done
- name: Create and push soci index
env:
tags: ${{ steps.meta.outputs.tags }}
short_sha: ${{ steps.vars.outputs.sha_short }}
run: |
for tag in $tags
do
echo "Creating soci index for $tag"
sudo soci create $tag
echo "Pushing soci index for $tag"
sudo soci push --user ${{ github.repository_owner }}:${{ secrets.GHCR_PAT }} $tag
done

0 comments on commit 07bd48f

Please sign in to comment.