Files
wlan-cloud-ucentralfms/.github/workflows/ci.yml
Johann Hoffmann 3a93d15ccd [WIFI-2919] Create a dockerfile for ucentralsec and ucentralfms services and add it to docker-compose (#1)
* Add Dockerfile and CI workflow

* Fix library locations and add run-time dependency
2021-07-09 15:37:30 +02:00

55 lines
1.3 KiB
YAML

name: CI
on:
push:
paths-ignore:
- 'openapi/**'
- '**.md'
branches:
- main
pull_request:
branches:
- main
defaults:
run:
shell: bash
jobs:
docker:
runs-on: ubuntu-20.04
env:
DOCKER_REGISTRY_URL: tip-tip-wlan-cloud-ucentral.jfrog.io
DOCKER_REGISTRY_USERNAME: ucentral
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: docker build -t wlan-cloud-ucentralfms:${{ github.sha }} .
- name: Log into Docker registry
uses: docker/login-action@v1
with:
registry: ${{ env.DOCKER_REGISTRY_URL }}
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Push Docker image
run: |
TAGS="${{ github.sha }}"
if [ ${GITHUB_REF} == "refs/heads/main" ]
then
TAGS="$TAGS ${GITHUB_REF#refs/heads/}"
else # PR build
CURRENT_TAG=$(echo ${GITHUB_HEAD_REF#refs/heads/} | tr '/' '-')
TAGS="$TAGS $CURRENT_TAG"
fi
echo "Pushing tags $TAGS"
for tag in $TAGS; do
docker tag wlan-cloud-ucentralfms:${{ github.sha }} ${{ env.DOCKER_REGISTRY_URL }}/ucentralfms:$tag
docker push ${{ env.DOCKER_REGISTRY_URL }}/ucentralfms:$tag
done