-
Notifications
You must be signed in to change notification settings - Fork 47
67 lines (64 loc) · 2.44 KB
/
publish-to-website.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
name: Publish to website
on:
push:
branches:
- main
paths:
- .github/workflows/publish-to-website.yml
- config/urls.yaml
- contributor/**
- introduction/**
- product-owner/**
- scripts/**
- trusted-committer/**
- workbook/**
# Checks if this workflow is already running, and if so cancels it
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Learning Path
uses: actions/checkout@v2
with:
path: ./InnerSourceLearningPath
ssh-key: ${{ secrets.LEARNING_PATH_DEPLOY_KEY }}
- name: Update Learning Path links in translations
working-directory: InnerSourceLearningPath/scripts
run: |
npm ci
node update_links_in_translations.js
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git diff --quiet || (git commit -am "Update Links in Translations" && git push)
- name: Checkout innersourcecommons.org
uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.WEBSITE_DEPLOY_KEY }}
path: ./innersourcecommons.org
repository: InnerSourceCommons/innersourcecommons.org
fetch-depth: 0
- name: Branch innersourcecommons.org
working-directory: innersourcecommons.org
run: |
git checkout
- uses: actions/setup-node@v1
with:
node-version: 18
- name: Build
working-directory: InnerSourceLearningPath/scripts
# The automated steps here need to be kept in sync manually with the written instructions at "/scripts/README.md"
# ("generate_learning_path_markdown.js" and "How to update innersourcecommons.org with new articles" sections).
run: |
npm ci
TOKEN=${{ secrets.GITHUB_TOKEN }} node generate_learning_path_markdown.js
cp -r newsite/. ../../innersourcecommons.org/content/en/learn/learning-path/
- name : Commit
working-directory: innersourcecommons.org
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git diff --staged --quiet || (git commit -m "Update Learning Path articles" && git push)