forked from reposense/RepoSense
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GitHub actions to test docker website (#20)
- Loading branch information
1 parent
822bc40
commit d7886e1
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 '.' | ||
|