Skip to content

ci: use valid tag name for pull request events. #179

ci: use valid tag name for pull request events.

ci: use valid tag name for pull request events. #179

Workflow file for this run

name: Base image build
on:
push:
tags:
- 'v*'
branches:
- main
pull_request:
jobs:
build_and_push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
matrix:
image:
- { dir: base, name: lnls-debian-11-epics-7 }
- { dir: base/musl, name: lnls-alpine-3.18-epics-7 }
env:
TAG: ${{ github.event_name == 'push' && github.ref_name || github.head_ref }}
REGISTRY: ghcr.io/${{ github.repository_owner }}
IMAGE: ${{ matrix.image.name }}
SOURCE: https://github.com/${{ github.repository }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to registry
if: github.event_name == 'push' && vars.PUSH_TO_REGISTRY == 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push tagged image
uses: docker/bake-action@v4
with:
workdir: ${{ matrix.image.dir }}
files: docker-compose.yml
set: |
*.cache-from=type=gha,scope=${{ matrix.image.name }}
*.cache-to=type=gha,mode=max,scope=${{ matrix.image.name }}
push: ${{ github.event_name == 'push' && vars.PUSH_TO_REGISTRY == 'true' && github.ref_type == 'tag' }}