Skip to content

Sync: Reset to upstream/main #2

Sync: Reset to upstream/main

Sync: Reset to upstream/main #2

Workflow file for this run

---
name: Docker
on:
workflow_dispatch:
workflow_call:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3.0.0
- name: Log in to the GH Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Docker metadata
if: github.event_name != 'pull_request'
id: meta
uses: docker/metadata-action@v5.5.0
with:
images: |
${{ secrets.DOCKERHUB_USERNAME }}/dlio
ghcr.io/${{ github.repository }}
- name: Build and push Docker image
if: github.event_name != 'pull_request'
id: build-and-push
uses: docker/build-push-action@v5.1.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max