Merge pull request #197 from ursais/bcb-add-frepple-eight #16
Workflow file for this run
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
name: Publish | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
env: | |
APPS: "backup frepple odoo postgresql pyspy" | |
OS: "centos debian redhat ubuntu" | |
ORG: ursa | |
DOCKER_BUILDKIT: 1 | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: "Operating Systems" | |
run: | | |
OLD_PWD=$(pwd) | |
for image in `find ${{ env.OS }} -name Dockerfile | sort -r`; do | |
echo "Building $image..." | |
DIR=$(dirname $image) | |
IMAGE_ID=$(echo $DIR | sed -e 's/^\.\///g' -e 's/\//-/g') | |
cd $DIR | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
[ "$VERSION" == "master" ] && VERSION=latest | |
docker build . --file Dockerfile --tag ${{ env.ORG }}/$IMAGE_ID:$VERSION --no-cache | |
echo "Build of $image completed!" | |
docker push ${{ env.ORG }}/$IMAGE_ID:$VERSION | |
! docker system prune -a -f | |
cd $OLD_PWD | |
done | |
- name: "Applications" | |
run: | | |
OLD_PWD=$(pwd) | |
for image in `find ${{ env.APPS }} -name Dockerfile | sort -r`; do | |
echo "Building $image..." | |
DIR=$(dirname $image) | |
IMAGE_ID=$(echo $DIR | sed -e 's/^\.\///g' -e 's/\//-/g') | |
cd $DIR | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
[ "$VERSION" == "master" ] && VERSION=latest | |
docker build . --file Dockerfile --tag ${{ env.ORG }}/$IMAGE_ID:$VERSION --no-cache | |
echo "Build of $image completed!" | |
docker push ${{ env.ORG }}/$IMAGE_ID:$VERSION | |
! docker system prune -a -f | |
cd $OLD_PWD | |
done |