Skip to content

ci/ghcr

ci/ghcr #134

Workflow file for this run

# Build Docker images and push them to GitHub Container Registry
name: ci/ghcr
on:
push:
branches:
- dockerhub
- master
paths:
- tests/docker/*.Dockerfile
schedule:
- cron: '45 3 4,14,24 * *'
jobs:
docker-build:
name: build-${{ matrix.tag }}
runs-on: ubuntu-latest
strategy:
matrix:
tag:
- bash-3.2
- centos-7
- debian-10
- debian-11
- debian-12
- scop
env:
DOCKER_TAG: ${{ matrix.tag }}
DOCKER_REPO: ghcr.io/sio/bash-complete-partial-path
DOCKER_USER: sio
DOCKER_REGISTRY: ghcr.io
steps:
- uses: actions/checkout@v3
- name: Build image and push it to registry
run: |
export DOCKERFILE=tests/docker/$DOCKER_TAG.Dockerfile
echo ${{ secrets.CONTAINER_REGISTRY_PERSONAL_ACCESS_TOKEN }} \
| docker login -u $DOCKER_USER --password-stdin $DOCKER_REGISTRY
docker build --pull --tag $DOCKER_REPO:$DOCKER_TAG - < $DOCKERFILE
docker push $DOCKER_REPO:$DOCKER_TAG