mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralfms.git
synced 2026-01-10 22:11:34 +00:00
55 lines
1.3 KiB
YAML
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
|