Skip to content

Allow setting default non-root user and group #12

Allow setting default non-root user and group

Allow setting default non-root user and group #12

Workflow file for this run

name: Docker
on:
push:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
env:
IMAGE_NAME: bubylou/steamcmd
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Docker buildx
uses: docker/[email protected]
# Login against a Github registry except on PR
- name: Log into github container registry
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Login for Docker registry
- name: Log into docker container registry
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: docker.io
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# Build and push Docker image with Bake (don't push on PR)
- name: Build and push Docker image
uses: docker/[email protected]
with:
push: ${{ github.event_name != 'pull_request' }}
targets: release-all
env:
TAG: ${{ github.ref_name }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: 'ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }}'
format: 'template'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'