This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
confluence-crud #523
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: confluence-crud | |
env: | |
CONFLUENCE_USER_NAME: ${{ secrets.CONFLUENCE_USER_NAME }} | |
CONFLUENCE_TOKEN: ${{ secrets.CONFLUENCE_TOKEN }} | |
BASE_URL: ${{ secrets.CONFLUENCE_URL }} | |
PAGES: "120392107,115081594,163422029,160074735" | |
on: | |
workflow_dispatch: | |
schedule: | |
# * is a special character in YAML, so you have to quote this string | |
- cron: '0 0 * * *' | |
jobs: | |
crud-confluenc: | |
name: Get and update contents from confluence | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: confluence/script | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Add Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: npm ci | |
- name: process script | |
run: | | |
node index.js | |
- name: Commit files # transfer the new html files back into the repository | |
id: commit | |
run: | | |
git config --local user.name ${{ github.actor }} | |
ls -lrt | |
git add ../pages | |
git commit -m "Adding or updating the confluence pages" || echo "No changes to commit" | |
- name: Push changes # push the output folder to your repo | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
force: true | |