48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
name: Upstream Sync Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
|
|
env:
|
|
DOCKER_IMAGE: convertx/convertx-cn
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get current date
|
|
id: date
|
|
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ env.DOCKER_IMAGE }}:upstream-${{ steps.date.outputs.date }}
|
|
platforms: linux/amd64,linux/arm64
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
- name: Summary
|
|
run: |
|
|
echo "## 🐳 Docker Image Published" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "**Image:** \`${{ env.DOCKER_IMAGE }}:upstream-${{ steps.date.outputs.date }}\`" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "This is an upstream sync build. Use version tags for stable releases." >> $GITHUB_STEP_SUMMARY
|