mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-28 07:14:05 -06:00
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
name: Docker build & push image
|
|
|
|
on:
|
|
push:
|
|
branches: [v4]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
docker:
|
|
if: ${{ github.repository == 'jackyzha0/quartz' }} # Comment this out if you want to publish your own images on a fork!
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set lowercase repository owner environment variable
|
|
run: |
|
|
echo "OWNER_LOWERCASE=${OWNER,,}" >>${GITHUB_ENV}
|
|
env:
|
|
OWNER: "${{ github.repository_owner }}"
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ env.OWNER_LOWERCASE }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|