Skip to content

Changed Dockerfile to use Pharo VM 10.3.0 (#20) #102

Changed Dockerfile to use Pharo VM 10.3.0 (#20)

Changed Dockerfile to use Pharo VM 10.3.0 (#20) #102

Workflow file for this run

name: Build and Publish Docker Images
on:
workflow_dispatch:
push:
branches:
- '**'
tags:
- 'v*.*.*'
pull_request:
jobs:
build_and_publish:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
name: Build and Publish Docker images
steps:
- name: Checkout
uses: actions/checkout@v4
# Build and publish runtime image
- name: Docker meta
id: docker_meta_runtime
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/pharo
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Docker build and push
uses: docker/build-push-action@v5
with:
context: ./source
file: ./source/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta_runtime.outputs.tags }}
labels: ${{ steps.docker_meta_runtime.outputs.labels }}
secrets: GIT_AUTH_TOKEN=${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
if: ${{ github.event_name != 'pull_request' }}
with:
image-ref: ghcr.io/${{ github.repository_owner }}/pharo:${{ github.ref_name }}
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
limit-severities-for-sarif: true
ignore-unfixed: true
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: ${{ github.event_name != 'pull_request' }}
with:
sarif_file: 'trivy-results.sarif'
category: ghcr.io/${{ github.repository_owner }}/pharo:${{ github.ref_name }}
# Build and publish loader image
- name: Docker meta loader
id: docker_meta_loader
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/pharo-loader
- name: Docker build and push loader
uses: docker/build-push-action@v5
if: ${{ github.event_name != 'pull_request' }}
with:
context: ./source
file: ./source/Dockerfile-loader
build-args: VERSION=${{ steps.docker_meta_runtime.outputs.version }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta_loader.outputs.tags }}
labels: ${{ steps.docker_meta_loader.outputs.labels }}
secrets: GIT_AUTH_TOKEN=${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
if: ${{ github.event_name != 'pull_request' }}
with:
image-ref: ghcr.io/${{ github.repository_owner }}/pharo-loader:${{ github.ref_name }}
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
limit-severities-for-sarif: true
ignore-unfixed: true
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: ${{ github.event_name != 'pull_request' }}
with:
sarif_file: 'trivy-results.sarif'
category: ghcr.io/${{ github.repository_owner }}/pharo-loader:${{ github.ref_name }}