feat: adding slim dockerfile #31
Workflow file for this run
This file contains 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: Container Images | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
release: | ||
types: [published] | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=pr | ||
type=ref,event=branch,branch=main,latest=true | ||
type=ref,event=branch,branch=main | ||
type=ref,event=branch,branch!=main | ||
type=semver,pattern={{version}},branch=main,latest=false | ||
type=ref,event=tag | ||
- name: Show tags | ||
run: | | ||
git tag | ||
echo ${{ steps.meta.outputs.tags }} | ||
- name: Log into GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push slim | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile.slim | ||
tags: ${{ steps.meta.outputs.tags }}-slim | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
Check failure on line 62 in .github/workflows/build.yaml GitHub Actions / Container ImagesInvalid workflow file
|
||
VERSION=${{ version }} | ||
BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") | ||
VCS_REF={{ github.sha }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
SLIM_IMAGE=${{ steps.meta.outputs.tags }}-slim |