Skip to content

Add GitHub Actions workflow for Docker build and push #2

Add GitHub Actions workflow for Docker build and push

Add GitHub Actions workflow for Docker build and push #2

Workflow file for this run

name: docker
on:
push:
branches:
- main
pull_request:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Determine Docker tags
id: tags
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "tags=${{ vars.DOCKERHUB_USERNAME }}/mdx2:latest" >> $GITHUB_OUTPUT
else
echo "tags=${{ vars.DOCKERHUB_USERNAME }}/mdx2:test" >> $GITHUB_OUTPUT
fi
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.tags.outputs.tags }}