ci/ghcr #157
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
# 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 |