Skip to content

Publish Docker Image #51

Publish Docker Image

Publish Docker Image #51

Workflow file for this run

name: Publish Docker Image
on:
workflow_run:
workflows: ["Tests"] # Name of the first workflow
types:
- completed
jobs:
push_to_registry:
name: Push Docker Image to Docker Hub
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: mikiejoe/portfoliocms
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args:
CLOUD_NAME=${{ secrets.CLOUD_NAME }}
API_KEY=${{ secrets.API_KEY }}
API_SECRET=${{ secrets.API_SECRET }}
DB_NAME=${{ secrets.DB_NAME }}
SECRET_KEY=${{ secrets.SECRET_KEY }}
DB_USER=${{ secrets.DB_USER }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
DB_HOST=${{ secrets.DB_HOST }}
DB_PORT=${{ secrets.DB_PORT }}
EMAIL_HOST_USER=${{ secrets.EMAIL_HOST_USER }}
EMAIL_HOST_PASSWORD=${{ secrets.EMAIL_HOST_PASSWORD }}
EMAIL_PORT=${{ secrets.EMAIL_PORT }}
EMAIL_HOST=${{ secrets.EMAIL_HOST }}