Merge pull request #4333 from georchestra/backport/23.0.x/pr-4331 #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "LDAP" | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- "ldap/**" | |
pull_request: | |
paths: | |
- "ldap/**" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: "Checking out" | |
uses: actions/checkout@v1 | |
- name: Getting image tag | |
id: version | |
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) | |
- name: "Building docker image" | |
if: github.repository == 'georchestra/georchestra' | |
working-directory: ldap/ | |
run: docker build -t georchestra/ldap:${{ steps.version.outputs.VERSION }} . | |
- name: "Logging in docker.io" | |
if: github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' | |
uses: azure/docker-login@v1 | |
with: | |
username: '${{ secrets.DOCKER_HUB_USERNAME }}' | |
password: '${{ secrets.DOCKER_HUB_PASSWORD }}' | |
- name: "Pushing latest to docker.io" | |
if: github.ref == 'refs/heads/master' && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' | |
run: | | |
docker tag georchestra/ldap:${{ steps.version.outputs.VERSION }} georchestra/ldap:latest | |
docker push georchestra/ldap:latest | |
- name: "Pushing release branch to docker.io" | |
if: contains(github.ref, 'refs/heads/23.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' | |
run: | | |
docker push georchestra/ldap:${{ steps.version.outputs.VERSION }} | |
- name: "Pushing release tag to docker.io" | |
if: contains(github.ref, 'refs/tags/23.') && github.repository == 'georchestra/georchestra' && github.actor != 'dependabot[bot]' | |
run: | | |
docker push georchestra/ldap:${{ steps.version.outputs.VERSION }} |