Skip to content

Commit

Permalink
Update GitHub actions to test docker website (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
CYX22222003 authored Feb 20, 2025
1 parent 822bc40 commit d7886e1
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: GitHub Actions build preview

concurrency:
group: publish_reposense_preview
cancel-in-progress: false

on:
workflow_run:
workflows: ["Continuous Integration"]
types:
- completed

jobs:
deploy:

name: deploy to github action
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Display current directory
run: pwd

- name: Download deployment artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: integration.yml
run_id: ${{ github.event.workflow_run.id }}
name: reposense-deployment
path: .

- name: Check existence of files
run: ls -al ./reposense-report

- name: Build docker container
run: |
git clone https://github.com/github/pages-gem
cd pages-gem
git checkout v232
make image
- name: Run local website on action runner
run: |
docker run --rm -d -p 4000:4000 -v ${SITE}:/src/site gh-pages
env:
SITE: ${{github.workspace}}/reposense-report

- name: Wait for the service to start
run: sleep 10

- name: Test connection to deployed website
run: curl -L http://0.0.0.0:4000/

- name: Test deployed web page
uses: treosh/lighthouse-ci-action@v12
with:
urls: http://0.0.0.0:4000/
uploadArtifacts: true

- name: Display Lighthouse summary
run: cat .lighthouseci/manifest.json | jq '.'

0 comments on commit d7886e1

Please sign in to comment.