firq-dev-website/.forgejo/workflows/unlighthouse.yml
Firq c754871a9b
All checks were successful
Linting and checking code / get-version (push) Successful in 2s
Build and deploy preview site / check-tag (push) Successful in 2s
Linting and checking code / astro-check (push) Successful in 12s
Build and deploy preview site / checking (push) Successful in 16s
Build and deploy preview site / build-site (push) Successful in 1m7s
Build and deploy preview site / run-unlighthouse (push) Successful in 0s
Build and deploy preview site / create-release (push) Successful in 7s
Build and deploy preview site / auto-deploy-dockge (push) Successful in 8s
Unlighthouse rework with docker 3
2024-11-01 15:59:40 +01:00

82 lines
2.7 KiB
YAML

name: Run unlighthouse-tests [Downstream pipeline]
run-name: Run unlighthouse-tests [Downstream pipeline] for version ${{ inputs.containertag }}
on:
workflow_dispatch:
inputs:
containertag:
description: "Tag of the container to test"
default: "preview"
type: "string"
jobs:
unlighthouse:
runs-on: docker
container:
image: forgejo.neshweb.net/ci-docker-images/unlighthouse:0.3.0
services:
website:
image: forgejo.neshweb.net/firq/firq-dev-website:${{ inputs.containertag }}
options: >-
--workdir /
steps:
- name: Checkout repository
uses: https://code.forgejo.org/actions/checkout@v3
- name: Check availability
run: |
while [ "$(curl -o /dev/null -s -w '%{http_code}' http://localhost:8081/)" -ne 200 ];
do echo "Waiting...";
sleep 5;
done;
- name: Run unlighthouse
run: unlighthouse-ci --site "http://localhost:8081/"
- name: Replace URLs
run: find ./unlighthouse-reports -type f | xargs sed -i "s|http://localhost:8081|https://preview.firq.dev|g";
- name: Prepare artifacts
run: cp serve.json unlighthouse-reports
- name: Upload reports
uses: actions/upload-artifact@v3
with:
name: unlighthouse-reports
path: unlighthouse-reports/
build-site:
needs: [ unlighthouse ]
if: success()
runs-on: dind
steps:
- name: Downloading static site artifacts
uses: actions/download-artifact@v3
with:
name: unlighthouse-reports
path: reports
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into Docker Package Registry
uses: docker/login-action@v3
with:
registry: forgejo.neshweb.net
username: ${{ secrets.FORGEJO_USERNAME }}
password: ${{ secrets.FORGEJO_TOKEN }}
- name: Build and push to Docker Package Registry
uses: docker/build-push-action@v5
with:
file: Dockerfile.reports
push: true
tags: forgejo.neshweb.net/firq/firq-dev-website-unlighthouse:latest
auto-deploy-dockge:
needs: [ build-site ]
if: success()
runs-on: docker
container: forgejo.neshweb.net/firq/dockge-cli:0.1.2
steps:
- name: Configure Dockge CLI
run: |
dockge host '${{ vars.DOCKGE_HOST }}'
dockge login --user '${{ secrets.DOCKGE_USER }}' --password '${{ secrets.DOCKGE_CREDENTIAL }}'
- name: Check status and redeploy
run: |
dockge status firq-dev-unlighthouse
dockge update firq-dev-unlighthouse
dockge status firq-dev-unlighthouse