Skip to content

Docker Build MYSQL

Docker Build MYSQL #46

Workflow file for this run

name: Docker Build MYSQL
on:
workflow_dispatch:
branches:
- master
schedule:
- cron: '0 2 * * 1'
env:
REGISTRY: ghcr.io
IMAGE_NAME: mysql
IMAGE_TAGS: "5.6 5.7 8.0"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: |
for tag in ${IMAGE_TAGS}; do
docker build . -f images/${{ env.IMAGE_NAME }}/${tag}/Dockerfile -t ${{ vars.DOCKER_REGISTRY_GITHUB }}/dockenv/${{ env.IMAGE_NAME }}:${tag}
done
docker tag ${{ vars.DOCKER_REGISTRY_GITHUB }}/dockenv/${{ env.IMAGE_NAME }}:8.0 ${{ vars.DOCKER_REGISTRY_GITHUB }}/dockenv/${{ env.IMAGE_NAME }}:latest
- name: Login Github Package Registry
run: |
docker login -u ${{vars.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ vars.DOCKER_REGISTRY_GITHUB }}
- name: Push Docker Image To Github Package
run: |
for tag in ${IMAGE_TAGS}; do
docker push ${{ vars.DOCKER_REGISTRY_GITHUB }}/dockenv/${{ env.IMAGE_NAME }}:${tag}
done
docker push ${{ vars.DOCKER_REGISTRY_GITHUB }}/dockenv/${{ env.IMAGE_NAME }}:latest