feat: Add configurable redirects. #121
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Sample workflow for building and deploying a Jekyll site to GitHub Pages | |
| name: Deploy site with Jekyll | |
| on: | |
| # Runs on pushes targeting the default branch | |
| push: | |
| branches: ["main"] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'The branch to checkout' | |
| required: true | |
| default: 'main' | |
| type: string | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| services: | |
| # we spin up a registry to share the image built by build-push-action with the later docker run step | |
| registry: | |
| image: registry:2 | |
| ports: | |
| - 5000:5000 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref_name }} | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| # this is required for the subsequent build to be able to push to the registry on localhost:5000 | |
| driver-opts: network=host | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: localhost:5000/kroxy-jekyll:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Load Jekyll configuration overrides | |
| # this is to enable forks to override the url and baseurl | |
| run: echo "${{ vars.JEKYLL_CONFIG_OVERRIDES }}" > _config-overrides.yml | |
| - name: Build with Jekyll | |
| # Outputs to the './_site' directory by default | |
| run: | | |
| docker run \ | |
| --rm \ | |
| -u "$(id -u):$(id -g)" \ | |
| -v "$(pwd):/site" \ | |
| localhost:5000/kroxy-jekyll:latest \ | |
| bash -c 'eval "$(rbenv init -)" && cp -r /css/_sass/bootstrap /site/_sass/ && bundle exec jekyll build --config=_config.yml,_config-overrides.yml' | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Upload artifact | |
| # Automatically uploads an artifact from the './_site' directory by default | |
| uses: actions/upload-pages-artifact@v3 | |
| # Deployment job | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |