Merge pull request #9 from NHSLeadership/develop #9
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 PHPFPM Images | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 5 1 * *" | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: frankenphp-base | |
| ORG: nhsleadership | |
| jobs: | |
| build-php82-image: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| security-events: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| - name: Build and push FrankenPHP Alpine 8.2 | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE_NAME }}:8.2-alpine | |
| labels: ${{ steps.meta.outputs.labels }} | |
| file: 'Dockerfile-alpine8.2' | |
| - name: Trivy scan PHP 8.2 image | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE_NAME }}:8.2-alpine | |
| # format: 'sarif' | |
| format: 'table' | |
| # output: 'trivy-results82alpine.sarif' | |
| severity: 'CRITICAL,HIGH' | |
| ignore-unfixed: true | |
| # - name: Upload Trivy PHP 8.2 Alpine results to GitHub Security tab | |
| # uses: github/codeql-action/upload-sarif@v3 | |
| # with: | |
| # sarif_file: 'trivy-results82alpine.sarif' | |
| build-php83-image: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| security-events: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| - name: Build and push FrankenPHP Alpine 8.3 | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE_NAME }}:8.3-alpine | |
| labels: ${{ steps.meta.outputs.labels }} | |
| file: 'Dockerfile-alpine8.3' | |
| - name: Trivy scan PHP 8.3 image | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE_NAME }}:8.3-alpine | |
| # format: 'sarif' | |
| format: 'table' | |
| # output: 'trivy-results83alpine.sarif' | |
| severity: 'CRITICAL,HIGH' | |
| ignore-unfixed: true | |
| # - name: Upload Trivy PHP 8.3 Alpine results to GitHub Security tab | |
| # uses: github/codeql-action/upload-sarif@v3 | |
| # with: | |
| # sarif_file: 'trivy-results83alpine.sarif' | |
| build-php84-image: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| security-events: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| - name: Build and push FrankenPHP Alpine 8.4 | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE_NAME }}:8.4-alpine | |
| labels: ${{ steps.meta.outputs.labels }} | |
| file: 'Dockerfile-alpine8.4' | |
| - name: Trivy scan PHP 8.4 image | |
| uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: ${{ env.REGISTRY }}/${{ env.ORG }}/${{ env.IMAGE_NAME }}:8.4-alpine | |
| # format: 'sarif' | |
| format: 'table' | |
| # output: 'trivy-results84alpine.sarif' | |
| severity: 'CRITICAL,HIGH' | |
| ignore-unfixed: true | |
| # - name: Upload Trivy PHP 8.4 Alpine results to GitHub Security tab | |
| # uses: github/codeql-action/upload-sarif@v3 | |
| # with: | |
| # sarif_file: 'trivy-results84alpine.sarif' |