-
Notifications
You must be signed in to change notification settings - Fork 80
86 lines (68 loc) · 2.14 KB
/
generate-index.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# **what?**
# Generate the new index.html for dbt-core as a GitHub artifact
# **why?**
# Automate the process of generating the new index.html so no local setup is required
# **when?**
# This will run when called in manually or as part of the workflow to generate a new index file for release.
name: Generate Index file for testing
on:
workflow_dispatch:
workflow_call:
outputs:
index_artifact_name:
description: The name of the index.html artifact
value: ${{ jobs.set_variables.outputs.index_artifact_name }}
defaults:
run:
shell: bash
permissions:
contents: read
pull-requests: write
jobs:
set_variables:
runs-on: ubuntu-latest
outputs:
index_artifact_name: ${{ steps.set.outputs.INDEX_ARTIFACT_NAME }}
steps:
- name: Set variables
id: set
run: |
echo "INDEX_ARTIFACT_NAME=index_file" >> $GITHUB_OUTPUT
- name: Print variables
id: print_variables
run: |
echo "Index Artifact Name: ${{ steps.set.outputs.INDEX_ARTIFACT_NAME }}"
build_index:
needs: [set_variables]
runs-on: ubuntu-latest
steps:
- name: Checkout dbt-docs repo
uses: actions/checkout@v4
- name: Update submodules
run: git submodule update --init --recursive
- name: Use Node.js v14.18.2
uses: actions/setup-node@v4
with:
node-version: 14.18.2
- name: Use Ruby v2.7.5
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.5'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: build the css files required for webpack
run: |
cd styles
bundle exec jekyll build
cd -
- name: Download the package and dependencies
run: npm install
- name: build the index.html file
run: npx webpack
- name: upload index.html artifact
uses: actions/upload-artifact@v4
with:
name: ${{ needs.set_variables.outputs.index_artifact_name }}
path: |
dist/index.html
if-no-files-found: error
retention-days: 15