chore: update the dependsOn to ghcr.io based images #2
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
| # This workflow builds and publishes the Crossplane configuration package to GitHub Container Registry (GHCR). | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| publish-crossplane-composition: | |
| name: Build and Publish Crossplane Composition - Latest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Install Crossplane CLI | |
| run: | | |
| curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh" | sh | |
| sudo mv crossplane /usr/local/bin | |
| crossplane version --client | |
| - name: Build Crossplane Configuration package | |
| run: | | |
| echo "### Build Configuration .xpkg file" | |
| crossplane xpkg build --package-file="package.xpkg" --package-root=. --examples-root="./example" --ignore=".github/workflows/*" --verbose | |
| - name: Publish Configuration package to GHCR | |
| run: | | |
| echo "### Publish .xpkg to GHCR" | |
| crossplane xpkg push --verbose --package-files=package.xpkg ghcr.io/${{ github.repository_owner }}/nextdns-crossplane-composition:latest | |