Update versions and deploy #265
This file contains hidden or 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 versions and deploy | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: '0 2 * * *' | |
| jobs: | |
| update-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config url.https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/.insteadOf https://github.com/ | |
| git config user.name "${{ github.actor }}" | |
| git config user.email "${{ github.actor }}@users.noreply.github.com" | |
| - name: Update versions | |
| run: bash bin/update-versions.sh | |
| - name: Commit and push changes | |
| run: | | |
| date +%m >.github/keep-alive | |
| git add . | |
| if ! git diff --cached --quiet; then | |
| git commit -m "update versions" | |
| git push origin | |
| else | |
| echo "No changes to commit." | |
| fi | |
| - name: Deploy gh-pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: public | |
| cname: registry.automad.org |