Skip to content

Merge pull request #10 from NetLah/dev/10.7.1_40 #7

Merge pull request #10 from NetLah/dev/10.7.1_40

Merge pull request #10 from NetLah/dev/10.7.1_40 #7

Workflow file for this run

name: CrushFTP Source
on:
push:
branches: ["dev-source-*", "source/*", "dev-source/*"]
tags: ["source-*.*.*"]
pull_request:
branches: [main]
jobs:
build:
strategy:
fail-fast: false
name: crushftp-source
runs-on: ubuntu-latest
env:
CRUSHFTP_VERSION: "10.7.1"
IS_TAG: ${{ startsWith(github.ref, 'refs/tags/') }}
SKIP_DOCKER: false
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
if: ${{ success() && env.SKIP_DOCKER != 'true' }}
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: ${{ success() && env.SKIP_DOCKER != 'true' && github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
username: "${{ secrets.DOCKER_HUB_USERNAME }}"
password: "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}"
- name: Build and push
if: ${{ success() && env.SKIP_DOCKER != 'true' }}
shell: pwsh
working-directory: ./crushftp-source
run: |
$pattern = '^source-(?<version>\d+\.\d+(\.\d+)?(_.+)?)$'
$crushFtpVersion = '${{ env.CRUSHFTP_VERSION }}'
$imageTag = '${{ github.ref_name }}'.Replace('/','-')
$whatIf = '${{ github.event_name == 'pull_request' }}' -eq $true
if ('${{ env.IS_TAG }}' -eq $true) {
$repos += @('${{ vars.DOCKER_HUB_NETLAH_SOURCE_REPOS }}')
if ('${{ github.ref_name }}' -match $pattern) {
$crushFtpVersion = '${{ github.ref_name }}' -replace $pattern,'${version}'
$imageTag = $crushFtpVersion
}
}
$repos += @('${{ secrets.DOCKER_HUB_SOURCE_REPOS }}')
./docker-build.ps1 -dockerRepository $repos -crushFtpVersion $crushFtpVersion -imageTag $imageTag -WhatIf:$whatIf -Verbose