I’m setting up custom GitHub Action workflow to publish Angular app to GitHub Pages. The workflow runs without errors but the result is 404 page.
name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
# - name: SonarQube Backend Scan
# uses: kitabisa/[email protected]
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install Dependencies
working-directory: .
run: npm install
- name: Build
working-directory: .
run: npm run build --if-present
# - name: Test
# working-directory: src/main/frontend
# run: npm test
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: './dist/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
Source code
The log:
2024-06-30T11:36:50.4480678Z Current runner version: '2.317.0'
2024-06-30T11:36:50.4502547Z ##[group]Operating System
2024-06-30T11:36:50.4503178Z Ubuntu
2024-06-30T11:36:50.4503612Z 22.04.4
2024-06-30T11:36:50.4503966Z LTS
2024-06-30T11:36:50.4504302Z ##[endgroup]
2024-06-30T11:36:50.4504710Z ##[group]Runner Image
2024-06-30T11:36:50.4505157Z Image: ubuntu-22.04
2024-06-30T11:36:50.4505561Z Version: 20240624.1.0
2024-06-30T11:36:50.4506586Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240624.1/images/ubuntu/Ubuntu2204-Readme.md
2024-06-30T11:36:50.4508006Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240624.1
2024-06-30T11:36:50.4508851Z ##[endgroup]
2024-06-30T11:36:50.4509315Z ##[group]Runner Image Provisioner
2024-06-30T11:36:50.4509757Z 2.0.370.1
2024-06-30T11:36:50.4510094Z ##[endgroup]
2024-06-30T11:36:50.4511107Z ##[group]GITHUB_TOKEN Permissions
2024-06-30T11:36:50.4512614Z Contents: write
2024-06-30T11:36:50.4513183Z Metadata: read
2024-06-30T11:36:50.4513721Z Pages: write
2024-06-30T11:36:50.4514270Z ##[endgroup]
2024-06-30T11:36:50.4517372Z Secret source: Actions
2024-06-30T11:36:50.4517966Z Prepare workflow directory
2024-06-30T11:36:50.5129035Z Prepare all required actions
2024-06-30T11:36:50.5293218Z Getting action download info
2024-06-30T11:36:50.7613266Z Download action repository 'actions/checkout@v3' (SHA:f43a0e5ff2bd294095638e18286ca9a3d1956744)
2024-06-30T11:36:50.8617345Z Download action repository 'actions/setup-node@v3' (SHA:1a4442cacd436585916779262731d5b162bc6ec7)
2024-06-30T11:36:50.9560422Z Download action repository 'actions/configure-pages@v3' (SHA:b8130d9ab958b325bbde9786d62f2c97a9885a0e)
2024-06-30T11:36:51.5029387Z Download action repository 'actions/upload-pages-artifact@v2' (SHA:a753861a5debcf57bf8b404356158c8e1e33150c)
2024-06-30T11:36:51.8521564Z Download action repository 'actions/deploy-pages@v2' (SHA:de14547edc9944350dc0481aa5b7afb08e75f254)
2024-06-30T11:36:52.4578463Z Getting action download info
2024-06-30T11:36:52.6030466Z Download action repository 'actions/upload-artifact@v3' (SHA:a8a3f3ad30e3422c9c7b888a15615d19a852ae32)
2024-06-30T11:36:52.6643240Z Complete job name: build (18.x)
2024-06-30T11:36:52.7434239Z ##[group]Run actions/checkout@v3
2024-06-30T11:36:52.7434751Z with:
2024-06-30T11:36:52.7435112Z repository: mr-olufsen/webapp
2024-06-30T11:36:52.7435787Z token: ***
2024-06-30T11:36:52.7436091Z ssh-strict: true
2024-06-30T11:36:52.7436476Z persist-credentials: true
2024-06-30T11:36:52.7436941Z clean: true
2024-06-30T11:36:52.7437249Z sparse-checkout-cone-mode: true
2024-06-30T11:36:52.7437680Z fetch-depth: 1
2024-06-30T11:36:52.7438070Z fetch-tags: false
2024-06-30T11:36:52.7438365Z lfs: false
2024-06-30T11:36:52.7438689Z submodules: false
2024-06-30T11:36:52.7439088Z set-safe-directory: true
2024-06-30T11:36:52.7439414Z ##[endgroup]
2024-06-30T11:36:52.9169976Z Syncing repository: mr-olufsen/webapp
2024-06-30T11:36:52.9171872Z ##[group]Getting Git version info
2024-06-30T11:36:52.9172544Z Working directory is '/home/runner/work/webapp/webapp'
2024-06-30T11:36:52.9173665Z [command]/usr/bin/git version
2024-06-30T11:36:52.9190676Z git version 2.45.2
2024-06-30T11:36:52.9214752Z ##[endgroup]
2024-06-30T11:36:52.9242508Z Temporarily overriding HOME='/home/runner/work/_temp/fccdb74a-78c9-4d73-93a3-30acb3d24328' before making global git config changes
2024-06-30T11:36:52.9243831Z Adding repository directory to the temporary git global config as a safe directory
2024-06-30T11:36:52.9247596Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/webapp/webapp
2024-06-30T11:36:52.9292452Z Deleting the contents of '/home/runner/work/webapp/webapp'
2024-06-30T11:36:52.9297214Z ##[group]Initializing the repository
2024-06-30T11:36:52.9301122Z [command]/usr/bin/git init /home/runner/work/webapp/webapp
2024-06-30T11:36:52.9380904Z hint: Using 'master' as the name for the initial branch. This default branch name
2024-06-30T11:36:52.9384633Z hint: is subject to change. To configure the initial branch name to use in all
2024-06-30T11:36:52.9386327Z hint: of your new repositories, which will suppress this warning, call:
2024-06-30T11:36:52.9387539Z hint:
2024-06-30T11:36:52.9388406Z hint: git config --global init.defaultBranch <name>
2024-06-30T11:36:52.9389273Z hint:
2024-06-30T11:36:52.9390407Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2024-06-30T11:36:52.9391817Z hint: 'development'. The just-created branch can be renamed via this command:
2024-06-30T11:36:52.9392806Z hint:
2024-06-30T11:36:52.9393509Z hint: git branch -m <name>
2024-06-30T11:36:52.9394479Z Initialized empty Git repository in /home/runner/work/webapp/webapp/.git/
2024-06-30T11:36:52.9396967Z [command]/usr/bin/git remote add origin https://github.com/mr-olufsen/webapp
2024-06-30T11:36:52.9435898Z ##[endgroup]
2024-06-30T11:36:52.9436932Z ##[group]Disabling automatic garbage collection
2024-06-30T11:36:52.9440202Z [command]/usr/bin/git config --local gc.auto 0
2024-06-30T11:36:52.9479015Z ##[endgroup]
2024-06-30T11:36:52.9481374Z ##[group]Setting up auth
2024-06-30T11:36:52.9486549Z [command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
2024-06-30T11:36:52.9524169Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2024-06-30T11:36:52.9821422Z [command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
2024-06-30T11:36:52.9855687Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2024-06-30T11:36:53.0096408Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2024-06-30T11:36:53.0137272Z ##[endgroup]
2024-06-30T11:36:53.0138409Z ##[group]Fetching the repository
2024-06-30T11:36:53.0147731Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +b9dcc6be482e76ea5b415e0abc8e02a610c5625a:refs/remotes/origin/main
2024-06-30T11:36:53.4225271Z From https://github.com/mr-olufsen/webapp
2024-06-30T11:36:53.4226285Z * [new ref] b9dcc6be482e76ea5b415e0abc8e02a610c5625a -> origin/main
2024-06-30T11:36:53.4251128Z ##[endgroup]
2024-06-30T11:36:53.4252246Z ##[group]Determining the checkout info
2024-06-30T11:36:53.4254027Z ##[endgroup]
2024-06-30T11:36:53.4255115Z ##[group]Checking out the ref
2024-06-30T11:36:53.4260131Z [command]/usr/bin/git checkout --progress --force -B main refs/remotes/origin/main
2024-06-30T11:36:53.4369367Z Switched to a new branch 'main'
2024-06-30T11:36:53.4372950Z branch 'main' set up to track 'origin/main'.
2024-06-30T11:36:53.4377581Z ##[endgroup]
2024-06-30T11:36:53.4420629Z [command]/usr/bin/git log -1 --format='%H'
2024-06-30T11:36:53.4450877Z 'b9dcc6be482e76ea5b415e0abc8e02a610c5625a'
2024-06-30T11:36:53.4761386Z ##[group]Run actions/setup-node@v3
2024-06-30T11:36:53.4761932Z with:
2024-06-30T11:36:53.4762233Z node-version: 18.x
2024-06-30T11:36:53.4762583Z cache: npm
2024-06-30T11:36:53.4763021Z cache-dependency-path: package-lock.json
2024-06-30T11:36:53.4763497Z always-auth: false
2024-06-30T11:36:53.4763813Z check-latest: false
2024-06-30T11:36:53.4764469Z token: ***
2024-06-30T11:36:53.4764944Z ##[endgroup]
2024-06-30T11:36:53.6806613Z Found in cache @ /opt/hostedtoolcache/node/18.20.3/x64
2024-06-30T11:36:53.6816649Z ##[group]Environment details
2024-06-30T11:36:54.0107017Z node: v18.20.3
2024-06-30T11:36:54.0107681Z npm: 10.7.0
2024-06-30T11:36:54.0108122Z yarn: 1.22.22
2024-06-30T11:36:54.0109256Z ##[endgroup]
2024-06-30T11:36:54.0121351Z [command]/opt/hostedtoolcache/node/18.20.3/x64/bin/npm config get cache
2024-06-30T11:36:54.1389834Z /home/runner/.npm
2024-06-30T11:36:54.4971612Z npm cache is not found
2024-06-30T11:36:54.5105275Z ##[group]Run npm install
2024-06-30T11:36:54.5105741Z [36;1mnpm install[0m
2024-06-30T11:36:54.5219560Z shell: /usr/bin/bash -e {0}
2024-06-30T11:36:54.5219979Z ##[endgroup]
2024-06-30T11:36:58.0592783Z npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
2024-06-30T11:36:58.8565805Z npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
2024-06-30T11:36:59.0102416Z npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
2024-06-30T11:37:05.7494759Z
2024-06-30T11:37:05.7495869Z added 990 packages, and audited 991 packages in 11s
2024-06-30T11:37:05.7496607Z
2024-06-30T11:37:05.7497159Z 134 packages are looking for funding
2024-06-30T11:37:05.7498023Z run `npm fund` for details
2024-06-30T11:37:05.7509398Z
2024-06-30T11:37:05.7510371Z found 0 vulnerabilities
2024-06-30T11:37:05.7852705Z ##[group]Run npm run build --if-present
2024-06-30T11:37:05.7853333Z [36;1mnpm run build --if-present[0m
2024-06-30T11:37:05.7913974Z shell: /usr/bin/bash -e {0}
2024-06-30T11:37:05.7914335Z ##[endgroup]
2024-06-30T11:37:05.9187512Z
2024-06-30T11:37:05.9188168Z > [email protected] build
2024-06-30T11:37:05.9189005Z > ng build
2024-06-30T11:37:05.9191502Z
2024-06-30T11:37:06.5229059Z - Building...
2024-06-30T11:37:06.5229548Z
2024-06-30T11:37:16.3064680Z Initial chunk files | Names | Raw size | Estimated transfer size
2024-06-30T11:37:16.3066941Z main-ILM3M4T7.js | main | 936.14 kB | 185.83 kB
2024-06-30T11:37:16.3068782Z styles-BD2XYORA.css | styles | 303.93 kB | 29.55 kB
2024-06-30T11:37:16.3070727Z scripts-EEEIPNC3.js | scripts | 80.34 kB | 21.56 kB
2024-06-30T11:37:16.3100311Z polyfills-6EAL64PA.js | polyfills | 34.23 kB | 11.13 kB
2024-06-30T11:37:16.3101521Z
2024-06-30T11:37:16.3102472Z | Initial total | 1.35 MB | 248.06 kB
2024-06-30T11:37:16.3103412Z
2024-06-30T11:37:16.3104086Z Output location: /home/runner/work/webapp/webapp/dist/webapp
2024-06-30T11:37:16.3104870Z
2024-06-30T11:37:16.3106466Z ▲ [WARNING] 2 rules skipped due to selector errors:
2024-06-30T11:37:16.3107779Z .form-floating>~label -> Did not expect successive traversals.
2024-06-30T11:37:16.3109118Z .form-floating>~label -> Did not expect successive traversals.
2024-06-30T11:37:16.3110385Z Application bundle generation complete. [9.782 seconds]
2024-06-30T11:37:16.3111291Z
2024-06-30T11:37:16.3112017Z
2024-06-30T11:37:16.3112034Z
2024-06-30T11:37:16.3816259Z ##[group]Run actions/configure-pages@v3
2024-06-30T11:37:16.3816742Z with:
2024-06-30T11:37:16.3817154Z token: ***
2024-06-30T11:37:16.3817585Z enablement: false
2024-06-30T11:37:16.3817944Z ##[endgroup]
2024-06-30T11:37:16.6851825Z ##[group]Run actions/upload-pages-artifact@v2
2024-06-30T11:37:16.6852419Z with:
2024-06-30T11:37:16.6852730Z path: ./dist/
2024-06-30T11:37:16.6853050Z name: github-pages
2024-06-30T11:37:16.6853461Z retention-days: 1
2024-06-30T11:37:16.6853801Z env:
2024-06-30T11:37:16.6854077Z GITHUB_PAGES: true
2024-06-30T11:37:16.6854476Z ##[endgroup]
2024-06-30T11:37:16.7050574Z ##[group]Run tar
2024-06-30T11:37:16.7051015Z [36;1mtar [0m
2024-06-30T11:37:16.7051372Z [36;1m --dereference --hard-dereference [0m
2024-06-30T11:37:16.7051881Z [36;1m --directory "$INPUT_PATH" [0m
2024-06-30T11:37:16.7052422Z [36;1m -cvf "$RUNNER_TEMP/artifact.tar" [0m
2024-06-30T11:37:16.7052833Z [36;1m --exclude=.git [0m
2024-06-30T11:37:16.7053231Z [36;1m --exclude=.github [0m
2024-06-30T11:37:16.7053679Z [36;1m .[0m
2024-06-30T11:37:16.7085658Z shell: /usr/bin/sh -e {0}
2024-06-30T11:37:16.7086171Z env:
2024-06-30T11:37:16.7086475Z GITHUB_PAGES: true
2024-06-30T11:37:16.7087016Z INPUT_PATH: ./dist/
2024-06-30T11:37:16.7087333Z ##[endgroup]
2024-06-30T11:37:16.7150001Z ./
2024-06-30T11:37:16.7150658Z ./webapp/
2024-06-30T11:37:16.7151278Z ./webapp/3rdpartylicenses.txt
2024-06-30T11:37:16.7151957Z ./webapp/browser/
2024-06-30T11:37:16.7152500Z ./webapp/browser/main-ILM3M4T7.js
2024-06-30T11:37:16.7165074Z ./webapp/browser/polyfills-6EAL64PA.js
2024-06-30T11:37:16.7166109Z ./webapp/browser/styles-BD2XYORA.css
2024-06-30T11:37:16.7170170Z ./webapp/browser/index.html
2024-06-30T11:37:16.7171228Z ./webapp/browser/scripts-EEEIPNC3.js
2024-06-30T11:37:16.7172542Z ./webapp/browser/favicon.ico
2024-06-30T11:37:16.7227826Z ##[group]Run actions/upload-artifact@v3
2024-06-30T11:37:16.7228352Z with:
2024-06-30T11:37:16.7228620Z name: github-pages
2024-06-30T11:37:16.7229014Z path: /home/runner/work/_temp/artifact.tar
2024-06-30T11:37:16.7229529Z retention-days: 1
2024-06-30T11:37:16.7229841Z if-no-files-found: error
2024-06-30T11:37:16.7230200Z env:
2024-06-30T11:37:16.7230576Z GITHUB_PAGES: true
2024-06-30T11:37:16.7230877Z ##[endgroup]
2024-06-30T11:37:16.7850430Z With the provided path, there will be 1 file uploaded
2024-06-30T11:37:16.7852412Z Starting artifact upload
2024-06-30T11:37:16.7855131Z For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
2024-06-30T11:37:16.7856974Z Artifact name is valid!
2024-06-30T11:37:17.1225350Z Container for artifact "github-pages" successfully created. Starting upload of file(s)
2024-06-30T11:37:17.9074187Z Total size of all the files uploaded is 320238 bytes
2024-06-30T11:37:17.9075570Z File upload process has finished. Finalizing the artifact upload
2024-06-30T11:37:18.2597926Z Artifact has been finalized. All files have been successfully uploaded!
2024-06-30T11:37:18.2598746Z
2024-06-30T11:37:18.2599495Z The raw size of all the files that were specified for upload is 1454080 bytes
2024-06-30T11:37:18.2604072Z The size of all the files that were uploaded is 320238 bytes. This takes into account any gzip compression used to reduce the upload size, time and storage
2024-06-30T11:37:18.2605384Z
2024-06-30T11:37:18.2609222Z Note: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads
2024-06-30T11:37:18.2621672Z
2024-06-30T11:37:18.2622291Z Artifact github-pages has been successfully uploaded!
2024-06-30T11:37:18.2718342Z ##[group]Run actions/deploy-pages@v2
2024-06-30T11:37:18.2718792Z with:
2024-06-30T11:37:18.2719324Z token: ***
2024-06-30T11:37:18.2719667Z timeout: 600000
2024-06-30T11:37:18.2719956Z error_count: 10
2024-06-30T11:37:18.2720378Z reporting_interval: 5000
2024-06-30T11:37:18.2720725Z artifact_name: github-pages
2024-06-30T11:37:18.2721097Z preview: false
2024-06-30T11:37:18.2721505Z env:
2024-06-30T11:37:18.2721766Z GITHUB_PAGES: true
2024-06-30T11:37:18.2722099Z ##[endgroup]
2024-06-30T11:37:18.6961899Z Artifact exchange URL: https://pipelinesghubeus5.actions.githubusercontent.com/8hWRsG9Mf9GU1lu6fo8MHPQDh0xYGMqFAHEtD8DKwqiD7u4RUQ/_apis/pipelines/workflows/9731679898/artifacts?api-version=6.0-preview
2024-06-30T11:37:18.9956105Z Creating Pages deployment with payload:
2024-06-30T11:37:18.9957395Z {
2024-06-30T11:37:18.9960493Z "artifact_url": "https://pipelinesghubeus5.actions.githubusercontent.com/8hWRsG9Mf9GU1lu6fo8MHPQDh0xYGMqFAHEtD8DKwqiD7u4RUQ/_apis/pipelines/1/runs/2/artifacts?artifactName=github-pages&%24expand=SignedContent",
2024-06-30T11:37:18.9963127Z "pages_build_version": "b9dcc6be482e76ea5b415e0abc8e02a610c5625a",
2024-06-30T11:37:19.0029165Z "oidc_token": "***"
2024-06-30T11:37:19.0029615Z }
2024-06-30T11:37:19.3222054Z Created deployment for b9dcc6be482e76ea5b415e0abc8e02a610c5625a, ID: b9dcc6be482e76ea5b415e0abc8e02a610c5625a
2024-06-30T11:37:24.3310379Z Getting Pages deployment status...
2024-06-30T11:37:24.5058783Z Reported success!
2024-06-30T11:37:24.5193979Z Post job cleanup.
2024-06-30T11:37:24.6930012Z [command]/usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/runner/work/webapp/webapp --files-from manifest.txt --use-compress-program zstdmt
2024-06-30T11:37:28.6734828Z Cache Size: ~80 MB (83667971 B)
2024-06-30T11:37:29.0175349Z Cache saved successfully
2024-06-30T11:37:29.0345864Z Cache saved with the key: node-cache-Linux-npm-823668ae3e95ab9d5d925a6195b0ce8a870fce76484d9a3ae1b248a8d9d87282
2024-06-30T11:37:29.0498110Z Post job cleanup.
2024-06-30T11:37:29.1306484Z [command]/usr/bin/git version
2024-06-30T11:37:29.1350137Z git version 2.45.2
2024-06-30T11:37:29.1389615Z Temporarily overriding HOME='/home/runner/work/_temp/424a3247-fd4e-44cb-b020-8088468792a8' before making global git config changes
2024-06-30T11:37:29.1391254Z Adding repository directory to the temporary git global config as a safe directory
2024-06-30T11:37:29.1395477Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/webapp/webapp
2024-06-30T11:37:29.1435960Z [command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
2024-06-30T11:37:29.1474004Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2024-06-30T11:37:29.1722451Z [command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
2024-06-30T11:37:29.1751145Z http.https://github.com/.extraheader
2024-06-30T11:37:29.1763114Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2024-06-30T11:37:29.1799828Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2024-06-30T11:37:29.2250169Z Evaluate and set environment url
2024-06-30T11:37:29.2253764Z Evaluated environment url: https://mr-olufsen.github.io/webapp/
2024-06-30T11:37:29.2254621Z Cleaning up orphan processes
Config: