forked from Apicurio/apicurio-data-models
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·55 lines (46 loc) · 1.88 KB
/
update-website.yaml
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
name: Update Website
on:
workflow_dispatch: {}
release:
types: [released]
jobs:
update-website:
if: github.repository_owner == 'Apicurio'
runs-on: ubuntu-18.04
steps:
- name: Apicurio Website Code Checkout
run: |
mkdir website
cd website
git init
git config --global user.name "apicurio-ci"
git config --global user.email "[email protected]"
git remote add origin "https://apicurio-ci:${{ secrets.ACCESS_TOKEN }}@github.com/Apicurio/apicurio.github.io.git"
git fetch
git checkout master
git branch --set-upstream-to=origin/master
git pull
- name: Fetch required Details
run: echo "RELEASE_VERSION=$(curl https://api.github.com/repos/apicurio/apicurio-data-models/releases/latest | jq '.name' | sed 's/"//g')" >> $GITHUB_ENV
- name: Updating Project Website for Release ${{ env.RELEASE_VERSION }}
run: |
cd website
echo "********** Replacing Existing Latest Release JSON File **********"
cd _data/datamodels
rm latestRelease.json
touch latestRelease.json && curl https://api.github.com/repos/apicurio/apicurio-data-models/releases/latest > latestRelease.json
echo "********** Saving a copy in the archieve **********"
cp latestRelease.json releases/${RELEASE_VERSION}.json
- name: Commit Project Website Changes
run: |
cd website
git add .
git commit -m "Automated Update For Apicurio Data Models Release Version: ${{ env.RELEASE_VERSION }}"
git push
- name: Google Chat Notification
if: ${{ failure() }}
uses: Co-qn/google-chat-notification@releases/v1
with:
name: ${{ github.workflow }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
status: ${{ job.status }}