Skip to content

Commit

Permalink
Update bicep to push to ghcr (#674)
Browse files Browse the repository at this point in the history
* update bicep to push to ghcr

* update tagged version

* test latest

* test latest

* update image src

* update image src

* test release version

* update on push

* nit

* testing

* testing

* testing

* testing

* revert

* just testing

* revert

* change directory

* update upload path

* updating if condition
  • Loading branch information
sk593 authored Oct 10, 2023
1 parent 6b41029 commit 29b2201
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/radius-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ env:
# disable telemetry (reduces dotnet tool output in logs)
DOTNET_CLI_TELEMETRY_OPTOUT: true
RELEASE_PATH: ./release
# ORAS (OCI Registry As Storage) CLI version
ORAS_VERSION: 1.1.0
# GitHub Actor for pushing images to GHCR
GHCR_ACTOR: rad-ci-bot
# Container registry url for GitHub container registry.
CONTAINER_REGISTRY: 'ghcr.io/radius-project/radius'
# URL to get source code for building the image
IMAGE_SRC: https://github.com/radius-project/bicep

jobs:
build:
Expand Down Expand Up @@ -244,10 +252,9 @@ jobs:
--title "Radius Bicep v${{ env.REL_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GH_RAD_CI_BOT_PAT }}

publish_blob:
publish_ghcr:
if: ${{ github.event_name == 'push' }}
name: Publish to Azure Blob Storage
name: Publish to GHCR
needs: ["build", "vscode-bicep-build"]
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -285,6 +292,24 @@ jobs:
- name: Display artifacts
run: ls -R
working-directory: ./artifacts
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ env.GHCR_ACTOR }}
password: ${{ secrets.GH_RAD_CI_BOT_PAT }}

- uses: oras-project/setup-oras@v1
with:
version: ${{ env.ORAS_VERSION }}
- run: oras version
- name: Push rad bicep binaries to GHCR (${{ matrix.runtime.name }})
run: |
cd ./artifacts/bicep/${{ matrix.runtime.name }} && oras push --annotation "org.opencontainers.image.source=${{ env.IMAGE_SRC }}" ${{ env.CONTAINER_REGISTRY }}/bicep/rad-bicep/${{ matrix.runtime.name }}:${{ env.UPDATE_RELEASE == 'true' && env.REL_VERSION || 'latest' }} ./rad-bicep${{ matrix.runtime.extension }}
- name: Check uploaded
run: curl --fail ${{ env.CONTAINER_REGISTRY }}/bicep/rad-bicep/${{ matrix.runtime.name }}:latest -v > out

# TODO: remove upload to blob storage once binaries are fully moved to GHCR
- uses: bacongobbler/[email protected]
name: Upload rad-bicep (${{ matrix.runtime.name }})
id: upload-rad-bicep
Expand Down Expand Up @@ -346,7 +371,7 @@ jobs:
delete_artifacts:
name: Delete artifacts
if: success()
needs: [ 'publish_blob' ]
needs: [ 'publish_ghcr' ]
runs-on: ubuntu-latest
steps:
- name: Delete release artifacts
Expand Down

0 comments on commit 29b2201

Please sign in to comment.