VIBECODED fix voor #164 #225
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: Build and Push to GHCR | |
| on: | |
| push: | |
| branches: | |
| - stable | |
| pull_request: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Broncode kopiëren | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # need full history to get refs & branch names reliably | |
| - name: Docker BuildX instellen | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Get git info | |
| id: gitinfo | |
| run: | | |
| # short commit and branch name | |
| echo "commit_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "branch_name=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT | |
| - name: Inloggen met GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GHCR_TOKEN }} | |
| - name: PolarLearn bouwen en pushen naar GHCR | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/polarlearn:latest | |
| ghcr.io/${{ github.repository_owner }}/polarlearn:${{ steps.gitinfo.outputs.commit_hash }} | |
| build-args: | | |
| NEXT_PUBLIC_GITINF=${{ steps.gitinfo.outputs.commit_hash }}@${{ steps.gitinfo.outputs.branch_name }} | |
| labels: | | |
| org.opencontainers.image.revision=${{ steps.gitinfo.outputs.commit_hash }} | |
| org.opencontainers.image.source=${{ github.repository }} | |
| org.opencontainers.image.version=${{ github.ref_name }} |