Skip to content

Commit

Permalink
Add upload to GHCR step
Browse files Browse the repository at this point in the history
  • Loading branch information
emostov committed Feb 21, 2024
1 parent 2df2cbf commit c647453
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,40 @@ jobs:
name: ${{ matrix.target }}
path: out/${{ matrix.target }}
retention-days: 1

upload_to_ghcr:
name: Upload toolchain artifacts to GHCR
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: read
packages: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
- name: Upload images to GHCR
env:
images: >-
qos_client
qos_enclave
qos_host
tags: >-
${{ github.ref == format('refs/heads/{0}', 'main') && 'latest' || '' }}
${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || '' }}
${{ github.event_name == 'push' && github.ref_name || '' }}
run: |
skopeo login \
--username "${{ github.actor }}" \
--password "${{ secrets.GITHUB_TOKEN }}" \
ghcr.io
for image in ${images}; do
skopeo copy --all \
"oci-archive:./${image}.oci.x86_64.tar/${image}.oci.x86_64.tar" \
"docker://ghcr.io/tkhq/${image}:sha-${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}"
for tag in ${tags}; do
skopeo copy --all \
"docker://ghcr.io/tkhq/${image}:sha-${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}" \
"docker://ghcr.io/tkhq/${image}:${tag}"
done
done

0 comments on commit c647453

Please sign in to comment.