Skip to content

Merge pull request #34 from OpenRailAssociation/renovate/major-github… #118

Merge pull request #34 from OpenRailAssociation/renovate/major-github…

Merge pull request #34 from OpenRailAssociation/renovate/major-github… #118

Workflow file for this run

# SPDX-FileCopyrightText: 2025 DB Systel GmbH
#
# SPDX-License-Identifier: Apache-2.0
name: Selftest Action
on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
push:
branches:
- main
env:
ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
dir_preview_subdir: "webdeploy-pr-${{ github.event.number }}"
condition_production: ${{ github.ref == 'refs/heads/main' }}
jobs:
build:
name: Build Website (Placeholder)
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Build website
run: |
echo "Simulating build..."
mkdir -p dist
echo "<html><body>
<p>Hello world: <a href="https://openrailassociation.org">LINK 1</a></p>
<p>Don't linkcheck me: <a href="https://example.com">LINK 2</a></p>
<p>Relative link: <a href="foobar.html">LINK 3</a></p>
<p>${{ github.ref }}.${{ github.event.pull_request.head.sha }}</p>
</body></html>" > dist/index.html
echo "baz" > dist/foobar.html
- name: Upload artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: website
path: dist
deploy:
name: Web Deployment
needs: build
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Call action locally
uses: ./
with:
artifact_name: website
condition_production: ${{ env.condition_production }}
domain_production: https://web-deployment-action.openrailassociation.org
domain_preview: https://web-preview.openrailassociation.org
dir_base: "/var/www/virtual/openrail"
dir_production: "web-deployment-action.openrailassociation.org"
dir_preview_base: "web-preview.openrailassociation.org"
dir_preview_subdir: ${{ env.dir_preview_subdir }}
ssh_host: uberspace1.openrailassociation.org
ssh_user: openrail
ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
linkchecker_exclude: "example.com,example.org"
linkchecker_include_fragments: true
linkchecker_verbose: true
gh_deployment: "preview"