Skip to content

Commit

Permalink
ci: add steps for ghcr
Browse files Browse the repository at this point in the history
Signed-off-by: r3drun3 <[email protected]>
  • Loading branch information
R3DRUN3 committed Jan 5, 2024
1 parent e5aceb6 commit a6516a7
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,14 @@ jobs:
# run: |
# docker push ${{ steps.copa.outputs.patched-image }}

- name: Save Patched Image Locally
- name: Login to GitHub Container Registry
if: steps.copa.conclusion == 'success'
run: |
original_image_name=$(echo "${{ matrix.images }}" | sed 's/\//_/g' | sed 's/:/_/')
mkdir -p "${GITHUB_WORKSPACE}/patched"
docker save -o "${GITHUB_WORKSPACE}/patched/${original_image_name}_patched.tar" ${{ steps.copa.outputs.patched-image }}
ls -l "${GITHUB_WORKSPACE}/patched"
mv "${GITHUB_WORKSPACE}/patched/${original_image_name}_patched.tar" "${GITHUB_WORKSPACE}/patched/"
ls -l "${GITHUB_WORKSPACE}/patched"
id: login
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Docker Push Patched Image to GitHub Container Registry
if: steps.login.conclusion == 'success'
run: |
docker tag ${{ steps.copa.outputs.patched-image }} ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.copa.outputs.patched-tag }}
docker push ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.copa.outputs.patched-tag }}
- name: Upload Patched Image as Artifact
if: steps.copa.conclusion == 'success'
uses: actions/upload-artifact@v2
with:
name: patched-images
path: patched

0 comments on commit a6516a7

Please sign in to comment.