2.2.1 #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Website | |
on: | |
workflow_dispatch: {} | |
release: | |
types: [released] | |
jobs: | |
update-website: | |
if: github.repository_owner == 'Apicurio' && (github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, '1.')) | |
runs-on: ubuntu-latest | |
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 main | |
git branch --set-upstream-to=origin/main | |
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 }} |