Skip to content

Merge pull request #6 from yinheli/main #1

Merge pull request #6 from yinheli/main

Merge pull request #6 from yinheli/main #1

Workflow file for this run

name: Build
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
- develop
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Login to Docker DockerHub
uses: docker/login-action@v3
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Prepare Docker tags
run: |
TAG=latest
if [[ $GITHUB_REF == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
fi
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
tags: |
${{ secrets.DOCKER_USERNAME }}/dify2openai:${{ env.TAG }}