Skip to content

[157] Use empty string as base_path if not entered #146

[157] Use empty string as base_path if not entered

[157] Use empty string as base_path if not entered #146

Workflow file for this run

name: Build and Push Docker Image for Pull Request Testing
on:
pull_request:
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set ghcr repository name
id: set-ghcr-repository
run: |
ghcr_name=$(echo "${{ github.repository }}" | awk '{ print tolower($0) }')
echo "ghcr-repository=${ghcr_name}" >> $GITHUB_OUTPUT
- name: Set Docker image metadata
id: docker-metadata
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ steps.set-ghcr-repository.outputs.ghcr-repository }}
tags: |
type=ref,event=pr
- name: Set up QEMU for cross-platform builds
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build and Push Docker image for Testing
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
platforms: linux/amd64
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}