Order post by year DESC and month ASC

To show a list by Year DESC and by month ASC:

change your post type with custom_post.

global $wpdb;

$posts = $wpdb->posts;

$sql = "SELECT DISTINCT(YEAR(`post_date`)) as years FROM $posts WHERE post_type="custom_post" ORDER BY years DESC"; //Get all post year list by DESC

$result = $wpdb->get_results($sql);

foreach($result as $rs) {
    echo '<h2>'.$rs->years.'</h2>';
    $args = array(
        'post_type' => 'custom_post',
        'post_per_page'=> -1,
        'post_status' => 'publish',
        'orderby'   => 'date',
        'order' => 'ASC',
        'date_query' => array(array(
            'year'=> $rs->years,
        ),),

    );

     $loop = new WP_Query($args);

     if($loop->have_posts()) {

        while($loop->have_posts()) : $loop->the_post();

            echo '<a href="'.get_permalink().'">'.get_the_date().'</a>';
        endwhile;

     }
}