Setup an nginx for Linux, macOS and Windows runner machines.
Go to file
Yuri Astrakhan a9a33330da
Update README.md
2024-05-22 23:33:59 -04:00
.github/workflows init 2024-05-22 23:28:50 -04:00
.gitignore init 2024-05-22 23:28:50 -04:00
LICENSE-APACHE init 2024-05-22 23:28:50 -04:00
LICENSE-MIT init 2024-05-22 23:28:50 -04:00
README.md Update README.md 2024-05-22 23:33:59 -04:00
action.yml init 2024-05-22 23:28:50 -04:00

README.md

GitHub Action: Setup NGINX

GitHub CI build

This action sets up a NGINX web server.

  • Runs on Linux, macOS and Windows GitHub runners
    • On Linux, assumes it is pre-installed
    • On macOS, installs using Homebrew
    • On Windows, assumes it is pre-installed
  • Overrides default configuration with a simpler and more cross-platform consistent one (can be user-supplied)
  • As output, provides the location of the root html dir, process ID, and access and error log files.
  • Easy to check that IT DOES NOT contain malicious code.

Usage

steps:
  - uses: nyurik/action-setup-nginx@v1
    id: nginx

  - run: |
      echo "Hello, world!" > "${{ steps.nginx.outputs.html-dir }}/index.html"
      
      curl http://localhost:${{ steps.nginx.outputs.port }}/
      # Expected output: Hello, world!

      cat "${{ steps.nginx.outputs.access-log }}"
      # Expected to contain a line with   GET /   HTTP/1.1   200      

Input parameters

Param Description Default
port The port number to use for the NGINX service, unless conf-file-text is set. 8080
conf-file-text Optional content of the nginx.conf file, overrides the default one

Outputs

Value Description
bin The path to the NGINX binary.
conf-path The path to the NGINX configuration file.
html-dir Default directory NGINX service uses as the root. This can be overridden by conf-file-text.
pid The process ID of the NGINX service.
port The port number used by the NGINX service.
access-log The path to the NGINX access log file, unless conf-file-text is provided.
error-log The path to the NGINX error log file, unless conf-file-text is provided.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.