Update index.html #10
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 Publish Docker Image | |
| # Wanneer moet dit draaien? | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| # Optioneel: Sta toe dat je het handmatig kunt starten via de Actions tab | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| # De naam van de image wordt standaard: ghcr.io/jouw-gebruikersnaam/jouw-repo-naam | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-and-push-image: | |
| runs-on: ubuntu-latest | |
| # Permissies instellen zodat de Action mag schrijven naar de Packages | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| # Stap 1: Check de code uit | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Stap 2: Log in bij de GitHub Container Registry | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Stap 3: Genereer metadata (tags en labels) | |
| # Dit zorgt ervoor dat de image getagged wordt als 'latest' en met de commit SHA | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=sha | |
| # Stap 4: Bouw de image en push deze naar GHCR | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |