Skip to content

Merge pull request #19 from SamuraiWTF/employee-list #16

Merge pull request #19 from SamuraiWTF/employee-list

Merge pull request #19 from SamuraiWTF/employee-list #16

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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 push basicphp image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-basic
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-basic --tag dojo-basic
docker tag dojo-basic $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name : Build and push basicdb image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-basic-db
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-basic-db --tag dojo-basic-db
docker tag dojo-basic-db $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name : Build and push scavengerphp image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-scavenger
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-scavenger --tag dojo-scavenger
docker tag dojo-scavenger $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name : Build and push scavengerdb image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/dojo-scavenger-db
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker build . --file .shogun/Dockerfile.dojo-scavenger-db --tag dojo-scavenger-db
docker tag dojo-scavenger-db $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION