Skip to content

Update docker-build-push.yaml #3

Update docker-build-push.yaml

Update docker-build-push.yaml #3

name: Build and Push Docker image
on:
push:
branches: [main] # Triggers when you push to the main branch
workflow_dispatch: # Allows to be run manually from the GitHub UI
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read # Needed to read the repo content
packages: write # Needed to publish to GHCR (GitHub Container Registry)
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract repository name
id: meta
run: echo "REPO=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Extract repository lowercase name
id: repo_lowercase
run: echo "REPO_LOWERCASE=${GITHUB_REPOSITORY@L}" >> $GITHUB_ENV # Print the repo as lowercase in env variables, needed for GHCR
- name: Build and Push Docker image
uses: docker/build-push-action@v6
with:
context: ./src
push: false
tags: ghcr.io/${{ env.REPO_LOWERCASE }}/frameweaver:latest