From a6516a7a2327d3ea704dea246fa4026027a3bde5 Mon Sep 17 00:00:00 2001 From: r3drun3 Date: Fri, 5 Jan 2024 15:39:07 +0100 Subject: [PATCH] ci: add steps for ghcr Signed-off-by: r3drun3 --- .github/workflows/patch.yaml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/patch.yaml b/.github/workflows/patch.yaml index 73f78de..757bd06 100644 --- a/.github/workflows/patch.yaml +++ b/.github/workflows/patch.yaml @@ -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 \ No newline at end of file