diff --git a/.github/workflows/push-buildpackage.yml b/.github/workflows/push-buildpackage.yml index 8812ac8..84dfeda 100644 --- a/.github/workflows/push-buildpackage.yml +++ b/.github/workflows/push-buildpackage.yml @@ -10,16 +10,26 @@ jobs: name: Push runs-on: ubuntu-latest steps: + + - name: Parse Event + id: event + run: | + echo "::set-output name=tag::$(jq -r '.release.tag_name' "${GITHUB_EVENT_PATH}" | sed s/^v//)" + echo "::set-output name=download_url::$(jq -r '.release.assets[] | select(.name | endswith(".cnb")) | .url' "${GITHUB_EVENT_PATH}")" + - name: Download id: download - env: - GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - uses: paketo-buildpacks/github-config/actions/buildpackage/download@main + uses: paketo-buildpacks/github-config/actions/release/download-asset@main + with: + url: ${{ steps.event.outputs.download_url }} + output: "${GITHUB_WORKSPACE}/buildpackage.cnb" + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - name: Push env: GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} GCR_PUSH_BOT_JSON_KEY: ${{ secrets.GCR_PUSH_BOT_JSON_KEY }} run: | echo "${GCR_PUSH_BOT_JSON_KEY}" | docker login --username _json_key --password-stdin gcr.io - sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/${{ steps.download.outputs.buildpackage }}" "docker://gcr.io/${{ github.repository }}:${{ steps.download.outputs.tag }}" - sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/${{ steps.download.outputs.buildpackage }}" "docker://gcr.io/${{ github.repository }}:latest" + sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:${{ steps.event.outputs.tag }}" + sudo skopeo copy "oci-archive:${GITHUB_WORKSPACE}/buildpackage.cnb" "docker://gcr.io/${{ github.repository }}:latest"