fix(ci): enable manual triggering of the publish workflow #22
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 Latest Crossplane Composition | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| publish-crossplane-composition: | |
| name: Build & Publish Crossplane Configuration Package | |
| 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/jacaudi/nextdns-crossplane-composition:latest | |