Skip to content

Add github actions

Add github actions #1

Workflow file for this run

name: CrushFTP Source
on:
push:
branches: ["dev-source-*", "source/*", "dev-source/*"]
tags: ["source-*.*.*"]
jobs:
build:
strategy:
fail-fast: false
name: crushftp-source
runs-on: ubuntu-latest
env:
IS_TAG: ${{ startsWith(github.ref, 'refs/tags/') }}
SKIP_DOCKER: false
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
if: ${{ success() && github.event_name != 'pull_request' }}
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
if: ${{ success() && github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
if: ${{ success() && env.SKIP_DOCKER != 'true' && github.event_name != 'pull_request' }}
shell: pwsh
working-directory: ./crushftp-source
run: |
if ('${{ env.IS_TAG }}' -eq $true) { $repos += @('${{ vars.DOCKER_HUB_NETLAH_SOURCE_REPOS }}') }
$repos += @('${{ secrets.DOCKER_HUB_SOURCE_REPOS }}')
./docker-build.ps1 -dockerRepository $repos