Skip to content

Update container

Update container #9

Workflow file for this run

name: Build and publish Docker images
on:
push:
paths:
- "*/**"
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish Docker images
run: |
for dir in */; do
if [ -n "$(git diff --name-only HEAD^ HEAD -- "$dir")" ]; then
docker build -t ghcr.io/${{ github.repository_owner }}/${dir%/}:${{ github.sha }} -t ghcr.io/${{ github.repository_owner }}/${dir%/}:latest $dir
docker push ghcr.io/${{ github.repository_owner }}/${dir%/} --all-tags
fi
done