Skip to content

Connection tests #139933

Connection tests

Connection tests #139933

name: Connection tests
on:
schedule:
- cron: '*/5 * * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# prevent independent loops, lets only use the sheduled runs
# push:
# branches:
# - main
#########################################################
# Concurrency allows to run 1 cycle at a time
# If worflow is running, 2nd one will automatically go in pending state
# if concurrency is enabled
# If 1st running, 2nd in pending and 3rd is triggered then 2nd which was
# in pending will be cancelled and only 3rd (latest) will run
#
# If this is enabled it will cancel current running and start latest
# cancel-in-progress: true
#
# When a concurrent job or workflow is queued,
# if another job or workflow using the same concurrency group in the repository
# is in progress, the queued job or workflow will be pending.
#
# Any previously pending job or workflow in the concurrency group will be canceled.
# To also cancel any currently running job or workflow in the same concurrency group,
# specify cancel-in-progress: true.
############################################################
concurrency:
group: connection-test
jobs:
connection-tests:
runs-on: ubuntu-latest
steps:
- name: Restore Cache
uses: actions/cache@v4
with:
path: |
~/.deno
~/.npm
key: ${{ runner.os }}-deps-${{ hashFiles('config.yml') }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Setup
uses: denoland/setup-deno@v1
- name: Additional setup
run: |
sudo apt-get install nmap
sudo npm -g install svgo
git config --local user.email "email-roboter@figuren.theater"
git config --local user.name "figuren-theater-bot"
- name: Perform connection tests
run: deno run --allow-net --allow-read --allow-write --allow-run --unstable source/tests.ts
- name: Update Timestamp
run: |
current_date=$(date +"%Y-%m-%d %H:%M:%S")
sed -i "s|<span id=\"last-updated\">[^<]*</span>|<span id=\"last-updated\">Updated: $current_date</span>|" index.html
- name: Optimize and commit results
run: |
npx svgo --multipass -f status
git add static/site hosts status README.md index.html
git commit -m "Update connection status"
git push