$args = array(
   'post_type' => 'post',
   'posts_per_page' => -1,
   'order' => 'DESC',
   'orderby' => 'date'
);

$posts = get_posts( $args );
$years = array();
foreach ( $posts as $post ) {
   $year = get_the_date( 'Y', $post->ID );
   if ( ! in_array( $year, $years ) ) {
      $years[] = $year;
   }
}

$current_year = isset( $_GET['year'] ) ? $_GET['year'] : '';
$base_url = get_home_url() . '/';

?>

<div class=post-year-filter>
   <span>Filter by year:</span>
   <?php foreach ( $years as $year ) { ?>
      <?php $active_class = ( $current_year == $year ) ? 'active' : ''; ?>
      <a href="<?php echo $base_url . '?post_type=post&year=' . $year; ?>" class="<?php echo $active_class; ?>"><?php echo $year; ?></a>
   <?php } ?>
</div>

<?php

if ( $current_year ) {
   $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
   $args = array(
      'post_type' => 'post',
      'posts_per_page' => 10,
      'paged' => $paged,
      'order' => 'DESC',
      'orderby' => 'date',
      'year' => $current_year
   );

   $query = new WP_Query( $args );
   if ( $query->have_posts() ) {
      while ( $query->have_posts() ) {
         $query->the_post();
         // display your post content here
      }

      $big = 999999999;
      echo paginate_links( array(
         'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
         'format' => '?paged=%#%',
         'current' => max( 1, get_query_var('paged') ),
         'total' => $query->max_num_pages
      ) );
   }
   wp_reset_postdata();
}

?>