name: Build & Release on: workflow_dispatch: push: branches: - "main" - "alpine" paths-ignore: - '.github/**' - 'docs/**' env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: Build: name: Build AMD64 runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@master - name: Set Vars id: set-vars run: | VERSION="1.0.0" BAIDUNETDISK_VERSION="4.17.7" GITHUB_REF=${{ github.ref }} BRACH=${GITHUB_REF#refs/heads/} DATE=$(date '+%Y-%m-%dT%H:%M:%S%Z') echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT echo "BAIDUNETDISK_VERSION=${BAIDUNETDISK_VERSION}" >> $GITHUB_OUTPUT echo "GITHUB_REF=${GITHUB_REF}" >> $GITHUB_OUTPUT echo "BRACH=${BRACH}" >> $GITHUB_OUTPUT - name: Docker Meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=raw,value=${{ steps.set-vars.outputs.VERSION }} type=raw,value=${{ steps.set-vars.outputs.BRACH }} type=raw,value=latest - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Github uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Buildx uses: docker/build-push-action@v5 with: context: . file: Dockerfile platforms: | linux/amd64 push: true build-args: | BUILD_DATE=${{ steps.set-vars.outputs.DATE }} VERSION=${{ steps.set-vars.outputs.VERSION }} BAIDUNETDISK_VERSION=${{ steps.set-vars.outputs.BAIDUNETDISK_VERSION }} labels: ${{ steps.meta.outputs.labels }} tags: ${{ steps.meta.outputs.tags }}