Add files to publish oci artifact #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish OCI Artifact | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| publish-artifact: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| # 1. Download the repository code | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 2. Configure ORAS CLI (Using the official action) | |
| # https://github.com/marketplace/actions/setup-oras | |
| - name: Set up ORAS | |
| uses: oras-project/setup-oras@v1 | |
| with: | |
| version: 1.3.0 | |
| # 3. Install JQ (Required to manipulate the JSON in the script) | |
| - name: Install JQ (JSON Processor) | |
| run: sudo apt-get update && sudo apt-get install -y jq | |
| # 4. Login to GitHub Container Registry | |
| - name: Log into GHCR | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | oras login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin | |
| # 5. Execute the publish script | |
| # The script will automatically read GITHUB_REPOSITORY, GITHUB_SHA, etc. | |
| - name: Execute Publish Script | |
| run: | | |
| chmod +x publish.sh | |
| ./publish.sh |