-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (57 loc) · 1.91 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Build and Deploy Portfolio
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
- name: Archive artifact
shell: sh
run: |
echo ::group::Archive artifact
tar \
--dereference --hard-dereference \
--directory "${{ github.workspace }}/dist/portfolio/browser/" \
-cvf "${{ github.workspace }}/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
echo ::endgroup::
env:
INPUT_PATH: ${{ inputs.path }}
- uses: actions/upload-artifact@v4
name: Upload GitHub Pages artifact
with:
name: github-pages
# Path of the directory containing the static assets.
path: ${{ github.workspace }}/artifact.tar
# Duration after which artifact will expire in days.
retention-days: 1
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
id-token: write
pages: write
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]