Skip to content

Update main.yml

Update main.yml #29

Workflow file for this run

name: Build and Deploy Portfolio
permissions:
id-token: write
pages: write
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
# This workflow contains a single job called "build"
build:
name: My Job
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Install Modules and Build
run: |
npm ci
npm run build
cd ./dist/portfolio/browser
ls -al
- name: Archive artifact
shell: sh
if: runner.os == 'Linux'
run: |
echo ::group::Archive artifact
tar \
--dereference --hard-dereference \
--directory "${{ github.workspace }}/dist/portfolio/browser/" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
echo ::endgroup::
env:
INPUT_PATH: ${{ inputs.path }}
- uses: actions/[email protected]
name: Upload GitHub Pages artifact
with:
name: github-pages
# Path of the directory containing the static assets.
path: "$RUNNER_TEMP/artifact.tar"
# Duration after which artifact will expire in days.
retention-days: 1
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3