name: Converge website
on:
  push:
    branches: [main]

env:
  WERF_SET_ACTIVE_RELEASE: "global.active_release=1.2"
  WERF_REPO: "ghcr.io/${{ github.repository_owner }}/werfio"

jobs:

  converge:
    name: Converge site to Production
    runs-on: tfprod-werf
    steps:

    - name: Checkout code
      uses: actions/checkout@v2
      with:
        fetch-depth: 0

    - name: Set version name
      id: value_set
      run: |
          echo "Version=$( echo $GITHUB_REF | cut -d\/ -f 3 | sed 's/\+/-plus-/' | sed 's/\_/-u-/')" >> $GITHUB_ENV

    - name: Generate artifacts
      run: |
          cd docs/site/.werf/artifacts
          bash generate_artifacts.sh

    - name: Converge
      uses: werf/actions/converge@v1.2
      with:
        env: production
      env:
        WERF_RELEASE: "werfio-site-production"
        WERF_NAMESPACE: "werfio-production"
        WERF_LOOSE_GITERMINISM: true
        WERF_DIR: "docs/site"
        WERF_LOG_VERBOSE: "on"
        WERF_KUBE_CONTEXT: prod
        WERF_SET_GITHUB_REF: "global.github_ref=${{ github.ref }}"

name: Converge website
on:
  push:
    branches: [main]
    paths:
      - 'docs/site/**'
      - 'docs/_config.yml'
      - 'docs/_config_ru.yml'
      - '.github/workflows/website_converge.yml'

env:
  WERF_SET_ACTIVE_RELEASE: "global.active_release=1.2"
  WERF_REPO: "ghcr.io/${{ github.repository_owner }}/werfio"

jobs:

  converge:
    name: Converge site to Production
    runs-on: tfprod-werf
    steps:

    - name: Checkout code
      uses: actions/checkout@v2
      with:
        fetch-depth: 0

    - name: Set version name
      id: value_set
      run: |
          echo "Version=$( echo $GITHUB_REF | cut -d\/ -f 3 | sed 's/\+/-plus-/' | sed 's/\_/-u-/')" >> $GITHUB_ENV

    - name: Generate artifacts
      run: |
          cd docs/site/.werf/artifacts
          bash generate_artifacts.sh

    - name: Converge
      uses: werf/actions/converge@v1.2
      with:
        env: production
      env:
        WERF_RELEASE: "werfio-site-production"
        WERF_NAMESPACE: "werfio-production"
        WERF_LOOSE_GITERMINISM: true
        WERF_DIR: "docs/site"
        WERF_LOG_VERBOSE: "on"
        WERF_KUBE_CONTEXT: prod
        WERF_SET_GITHUB_REF: "global.github_ref=${{ github.ref }}"

Deploy non-versioned site part only on appropriate changes in main branch
ci: Deploy non-versioned site part only on appropriate changes in main branch