Skip to content

publish-to-docker-hub #41

publish-to-docker-hub

publish-to-docker-hub #41

name: publish-to-docker-hub
on:
schedule:
- cron: "0 0 1 * *"
push:
branches:
- main
env:
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_NAMESPACE: ${{ secrets.DOCKER_HUB_NAMESPACE }}
VERSION: latest
jobs:
publish_php:
runs-on: ubuntu-latest
env:
IMAGE_NAME: "laravel-dev-image"
LANGUAGE: "php"
LANGUAGE_VERSION: 7.4
steps:
- uses: actions/checkout@v2
- run: echo ${DOCKER_HUB_PASSWORD} | docker login --username "${DOCKER_HUB_USER}" --password-stdin
- run: docker build . --file ${IMAGE_NAME}/Dockerfile -t ${IMAGE_NAME}
- run: docker tag "${IMAGE_NAME}" "${DOCKER_HUB_NAMESPACE}/${IMAGE_NAME}:${LANGUAGE}${LANGUAGE_VERSION}-${VERSION}"
- run: docker push "${DOCKER_HUB_NAMESPACE}/${IMAGE_NAME}:${LANGUAGE}${LANGUAGE_VERSION}-${VERSION}"
publish_python:
runs-on: ubuntu-latest
env:
IMAGE_NAME: "python-dev"
LANGUAGE: "python"
LANGUAGE_VERSION: 3.10
steps:
- uses: actions/checkout@v2
- run: echo ${DOCKER_HUB_PASSWORD} | docker login --username "${DOCKER_HUB_USER}" --password-stdin
- run: docker build . --file ${IMAGE_NAME}/Dockerfile -t ${IMAGE_NAME}
- run: docker tag "${IMAGE_NAME}" "${DOCKER_HUB_NAMESPACE}/${IMAGE_NAME}:${LANGUAGE}${LANGUAGE_VERSION}-${VERSION}"
- run: docker push "${DOCKER_HUB_NAMESPACE}/${IMAGE_NAME}:${LANGUAGE}${LANGUAGE_VERSION}-${VERSION}"
publish_node_pnpm:
runs-on: ubuntu-latest
env:
IMAGE_NAME: "node"
LANGUAGE: "node"
LANGUAGE_VERSION: 18
steps:
- uses: actions/checkout@v2
- run: echo ${DOCKER_HUB_PASSWORD} | docker login --username "${DOCKER_HUB_USER}" --password-stdin
- run: docker build . --file ${IMAGE_NAME}/Dockerfile -t ${IMAGE_NAME}
- run: docker tag "${IMAGE_NAME}" "${DOCKER_HUB_NAMESPACE}/${IMAGE_NAME}:${LANGUAGE}${LANGUAGE_VERSION}-${VERSION}"
- run: docker push "${DOCKER_HUB_NAMESPACE}/${IMAGE_NAME}:${LANGUAGE}${LANGUAGE_VERSION}-${VERSION}"