-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
0 additions
and
113 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 |
---|---|---|
|
@@ -99,41 +99,6 @@ jobs: | |
build_dir: _site | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
build_and_deploy_azure: | ||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | ||
needs: build | ||
runs-on: ubuntu-latest | ||
name: Build and Deploy Azure | ||
steps: | ||
- name: Use cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: "_site/" | ||
key: ${{ runner.os }}-${{ github.sha }} | ||
- name: Remove exercise images | ||
uses: JesseTG/[email protected] | ||
with: | ||
path: ./_site/assets/images/exercises/ | ||
- name: Remove exercise Pdfs | ||
uses: JesseTG/[email protected] | ||
with: | ||
path: ./_site/assets/pdf/ | ||
- name: Build And Deploy | ||
id: builddeploy | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_CALM_COAST_0BC93F003 }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | ||
action: "upload" | ||
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | ||
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | ||
skip_app_build: true | ||
app_location: "/_site" # App source code path | ||
api_location: "" # Api source code path - optional | ||
output_location: "" # Built app content directory - optional | ||
###### End of Repository/Build Configurations ###### | ||
env: | ||
JEKYLL_ENV: development | ||
test: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
@@ -172,81 +137,3 @@ jobs: | |
key: ${{ runner.os }}-${{ github.sha }} | ||
- name: ☁️ Cleaning up | ||
run: bundle exec jekyll clean | ||
close_pull_request_azure: | ||
if: github.event_name == 'pull_request' && github.event.action == 'closed' | ||
runs-on: ubuntu-latest | ||
name: Close Pull Request Job | ||
steps: | ||
- name: Close Pull Request | ||
id: closepullrequest | ||
uses: Azure/static-web-apps-deploy@v1 | ||
with: | ||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_CALM_COAST_0BC93F003 }} | ||
action: "close" | ||
lighthouse: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Lighthouse | ||
uses: foo-software/lighthouse-check-action@master | ||
with: | ||
urls: 'https://www.motionsplan.dk/,https://www.motionsplan.dk/bmi-beregner-boern-unge-teenagere/,https://www.motionsplan.dk/skridt-pr-km-10000/,https://www.motionsplan.dk/idealvaegt/' | ||
lighthouse_staging_azure: | ||
name: Lighthouse report | ||
needs: build_and_deploy_azure | ||
if: github.event_name == 'pull_request' && github.event.action != 'closed' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Static Web App - get preview URL | ||
id: static_web_app_preview_url | ||
uses: azure/CLI@v1 | ||
with: | ||
inlineScript: | | ||
CUSTOM_DOMAIN='calm-coast-0bc93f003.1.azurestaticapps.net' | ||
LOCATION='westeurope' | ||
PREVIEW_URL="https://${CUSTOM_DOMAIN/.[1-9]./-${{github.event.pull_request.number }}.$LOCATION.1.}" | ||
echo "::set-output name=PREVIEW_URL::$PREVIEW_URL" | ||
- name: Static Web App - wait for preview | ||
id: static_web_app_wait_for_preview | ||
uses: nev7n/wait_for_response@v1 | ||
with: | ||
url: '${{ steps.static_web_app_preview_url.outputs.PREVIEW_URL }}' | ||
responseCode: 200 | ||
timeout: 600000 | ||
interval: 1000 | ||
- name: Audit URLs using Lighthouse | ||
id: lighthouse_audit | ||
uses: treosh/lighthouse-ci-action@v8 | ||
with: | ||
urls: | | ||
${{ steps.static_web_app_preview_url.outputs.PREVIEW_URL }} | ||
${{ steps.static_web_app_preview_url.outputs.PREVIEW_URL }}/idealvaegt/ | ||
configPath: ./.github/workflows/lighthousesrc.json | ||
uploadArtifacts: true | ||
temporaryPublicStorage: true | ||
runs: 5 | ||
- name: Format lighthouse score | ||
id: format_lighthouse_score | ||
uses: actions/github-script@v5 | ||
with: | ||
script: | | ||
const lighthouseCommentMaker = require('./.github/workflows/lighthouseCommentMaker.js'); | ||
const lighthouseOutputs = { | ||
manifest: ${{ steps.lighthouse_audit.outputs.manifest }}, | ||
links: ${{ steps.lighthouse_audit.outputs.links }} | ||
}; | ||
const comment = lighthouseCommentMaker({ lighthouseOutputs }); | ||
core.setOutput("comment", comment); | ||
- name: Add Lighthouse stats as comment | ||
id: comment_to_pr | ||
uses: marocchino/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
number: ${{ github.event.pull_request.number }} | ||
header: lighthouse | ||
message: ${{ steps.format_lighthouse_score.outputs.comment }} |