Skip to content

feat: add GitHub workflow to push images to Docker Hub #2

feat: add GitHub workflow to push images to Docker Hub

feat: add GitHub workflow to push images to Docker Hub #2

Workflow file for this run

name: Push Docker images to Docker Hub
on:
push:
pull_request:
types:
- closed
branches:
- main
- dev
jobs:
push:
runs-on: ubuntu-latest
# These environment variables are required during runtime but not build time.
# As it is not possible to specify this in Docker compose,
# we pass dummy environment variables in order for this step to succeed.
env:
SECRETS_DIR: /this/is/a/dummy/path
SSL_DIR: /this/is/a/dummy/path
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
run: docker compose build
- name: Push
run: docker compose push