App-GHGen

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


## Static Sites

Static site deployment to GitHub Pages.

**Features:**

- GitHub Pages deployment
- Configurable build command
- Configurable build directory
- Artifact upload
- Proper Pages permissions
- Separate build and deploy jobs

# CONFIGURATION DETECTION

GHGen automatically detects configuration and adjusts workflows accordingly.

## Minimum Version Detection

For Perl, minimum version is detected from:

lib/App/GHGen.pm  view on Meta::CPAN

B<Features:>

=over 4

=item * GitHub Pages deployment

=item * Configurable build command

=item * Configurable build directory

=item * Artifact upload

=item * Proper Pages permissions

=item * Separate build and deploy jobs

=back

=head1 CONFIGURATION DETECTION

GHGen automatically detects configuration and adjusts workflows accordingly.

lib/App/GHGen/Fixer.pm  view on Meta::CPAN

    return $modified;
}

sub get_latest_version($action) {
    my %versions = (
        'actions/checkout' => 'v6',
        'actions/cache' => 'v5',
        'actions/setup-node' => 'v4',
        'actions/setup-python' => 'v5',
        'actions/setup-go' => 'v5',
        'actions/upload-artifact' => 'v4',
        'actions/download-artifact' => 'v4',
    );

    return $versions{$action} // 'v4';  # Default fallback
}

=head1 AUTHOR

Nigel Horne E<lt>njh@nigelhorne.comE<gt>

lib/App/GHGen/Generator.pm  view on Meta::CPAN

      - name: Checkout
        uses: actions/checkout@v7

      - name: Setup Pages
        uses: actions/configure-pages@v4

      - name: Build
        run: echo "Add your build command here"

      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: ./public

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:

t/extended_tests.t  view on Meta::CPAN

	my $yaml = generate_workflow('docker');
	like($yaml, qr/Docker Build/,        'docker workflow named correctly');
	like($yaml, qr/build-push-action/,   'includes build-push action');
	like($yaml, qr/login-action/,        'includes docker login');
};

subtest 'Generator::generate_workflow - static workflow has expected structure' => sub {
	my $yaml = generate_workflow('static');
	like($yaml, qr/Deploy Static Site/,  'static workflow named correctly');
	like($yaml, qr/deploy-pages/,        'includes deploy-pages action');
	like($yaml, qr/upload-pages-artifact/, 'includes artifact upload');
};

# =============================================================================
# 6.  App::GHGen::Interactive — _customize_* via mocked STDIN
# =============================================================================

subtest 'Interactive::customize_workflow - perl: collects all expected keys' => sub {
	# Feed answers for all prompts in _customize_perl.
	# Sequence: perl_versions, os, linter, unused, critic, coverage, branches.
	my @answers = (



( run in 2.825 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )