Skip to content

Commit 09123cf

Browse files
committed
Merge branch 'main' of github.com:jerdog/devex-and-devops-success-slidev
2 parents d482ec4 + 2025070 commit 09123cf

File tree

3 files changed

+38
-35
lines changed

3 files changed

+38
-35
lines changed
Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: build-and-deploy
22

3-
on: [push]
3+
on: [push,workflow_dispatch]
44

55
env:
66
BRANCH_NAME: ${{ github.ref_name }}
@@ -9,45 +9,40 @@ jobs:
99
build-and-deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: checkout code
13-
uses: actions/checkout@v4
14-
- name: setup node
15-
uses: actions/setup-node@v4
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
1614
with:
17-
node-version: 20
18-
# cache: "npm"
15+
node-version: lts/*
1916
- name: install slidevjs + playwright
2017
run: 'npm i -g @slidev/cli && npm i -D playwright-chromium'
18+
- name: Get npm cache directory
19+
id: npm-cache-dir
20+
shell: bash
21+
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
22+
- name: Cache node modules
23+
uses: actions/cache@v4
24+
id: cache
25+
with:
26+
path: ${{ steps.npm-cache-dir.outputs.dir }}
27+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-node-
30+
- name: install dependencies
31+
if: steps.cache.outputs.cache-hit != 'true'
32+
run: 'npm i'
2133
- name: build slides
2234
run: 'yes | slidev build'
23-
# - name: upload build
24-
# uses: actions/upload-artifact@v3
25-
# with:
26-
# name: build
27-
# path: dist
28-
- name: Install Netlify
29-
run: npm install [email protected] -g
35+
- name: Get short commit SHA
36+
id: vars
37+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
3038
- name: Deploy to Netlify
3139
id: netlify_deploy
3240
run: |
3341
prod_flag=""
3442
if [ "$BRANCH_NAME" = "main" ]; then prod_flag="--prod"; fi
3543
netlify deploy \
36-
--dir dist \
44+
--dir dist \
45+
--message "CLI deploy via ${{ github.ref_name }}: commit ${{ steps.vars.outputs.sha_short }}, ${{ github.event.commits[0].message }}" \
3746
--site ${{ secrets.NETLIFY_SITE_ID }} \
3847
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }} \
3948
$prod_flag
40-
41-
# deploy:
42-
# needs: build
43-
# runs-on: ubuntu-latest
44-
# name: 'Deploy to Netlify'
45-
# steps:
46-
# - uses: jsmrcaga/[email protected]
47-
# with:
48-
# build_directory: dist
49-
# build_command: 'npm i -g @slidev/cli ; npm i -D playwright-chromium ; yes | slidev build'
50-
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
51-
# NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
52-
# NETLIFY_DEPLOY_MESSAGE: "Prod deploy v${{ github.ref }}"
53-
# NETLIFY_DEPLOY_TO_PROD: true

netlify.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ CI = "false"
66
[build.environment]
77
NODE_VERSION = "20"
88

9+
[context.deploy-preview]
10+
command = "npm run build"
11+
CI = "false"
12+
13+
[context.branch-deploy]
14+
command = "npm run build"
15+
CI = "false"
16+
917
[[redirects]]
1018
from = "/.well-known/*"
1119
to = "/.well-known/:splat"

slides.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ A few of the core DevOps principles really bring this all together.
645645

646646
---
647647
transition: fade
648-
layout: top
648+
layout: default
649649
---
650650

651651
## DevOps Principles + DevEx alignment
@@ -661,7 +661,7 @@ layout: top
661661

662662
---
663663
transition: fade
664-
layout: top
664+
layout: default
665665
---
666666

667667
## DevOps Principles + DevEx alignment
@@ -675,7 +675,7 @@ layout: top
675675

676676
---
677677
transition: fade
678-
layout: top
678+
layout: default
679679
---
680680

681681
## DevOps Principles + DevEx alignment
@@ -691,7 +691,7 @@ The backbone of DevOps is effective **communication**, which ensures all members
691691

692692
---
693693
transition: fade
694-
layout: top
694+
layout: default
695695
---
696696

697697
## DevOps Principles + DevEx alignment
@@ -706,7 +706,7 @@ When we are **improving Communication** , we start to utilize platforms and tool
706706

707707
---
708708
transition: fade
709-
layout: top
709+
layout: default
710710
---
711711

712712
## DevOps Principles + DevEx alignment
@@ -723,7 +723,7 @@ layout: top
723723

724724
---
725725
transition: fade
726-
layout: top
726+
layout: default
727727
---
728728

729729
## DevOps Principles + DevEx alignment

0 commit comments

Comments
 (0)