69 lines
1.8 KiB
YAML
69 lines
1.8 KiB
YAML
name: Deploy To Development
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
paths-ignore:
|
|
- "README.md"
|
|
- ".vscode/**"
|
|
|
|
concurrency:
|
|
group: deploy-dev
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
setup:
|
|
name: Setup
|
|
runs-on: ubuntu-20.04
|
|
env:
|
|
IMAGE_REPO: reg.dev.krd/dit-docs/dsm-client
|
|
steps:
|
|
- name: Extract image name
|
|
run: |
|
|
REF_NAME=$(echo ${GITHUB_REF##*/})
|
|
echo "IMAGE=$IMAGE_REPO:$REF_NAME" >> $GITHUB_ENV
|
|
outputs:
|
|
image: ${{ env.IMAGE }}
|
|
image-sha: ${{ env.IMAGE }}-${{ github.sha }}
|
|
|
|
test:
|
|
uses: ditkrg/dit-digital-service-manual/.github/workflows/tests-base.yaml@dev
|
|
|
|
build-push:
|
|
name: Build and Push
|
|
needs: [setup, test]
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: reg.dev.krd
|
|
username: ${{ secrets.HARBOR_PUBLIC_USER }}
|
|
password: ${{ secrets.HARBOR_PUBLIC_TOKEN }}
|
|
|
|
- name: Build and push Docker images
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
tags: |-
|
|
${{ needs.setup.outputs.image }}
|
|
${{ needs.setup.outputs.image-sha }}
|
|
cache-from: type=registry,ref=${{ needs.setup.outputs.image }}-buildcache
|
|
cache-to: type=registry,ref=${{ needs.setup.outputs.image }}-buildcache,mode=max
|
|
|
|
deploy:
|
|
uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@dev
|
|
needs: [setup, build-push]
|
|
with:
|
|
image: ${{ needs.setup.outputs.image-sha }}
|
|
env_url: https://service-manual.docs.dev.krd
|
|
env_name: development
|
|
|
|
secrets:
|
|
KUBECONFIG: ${{ secrets.KUBECONFIG }}
|