v9.2.0-beta.2-hugo-0.157.0 #231
Workflow file for this run
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: Write version to file | |
| on: | |
| release: | |
| types: | |
| - prereleased | |
| - released | |
| permissions: | |
| contents: write | |
| jobs: | |
| update_version_file: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Release tag | |
| run: | | |
| echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME" | |
| echo "Tag name from github.ref_name: ${{ github.ref_name }}" | |
| echo "Tag name from github.event.release.tag_name: ${{ github.event.release.tag_name }}" | |
| - name: Overwrite file | |
| uses: "DamianReeves/write-file-action@master" | |
| with: | |
| path: ./static/osuny-theme-version.txt | |
| write-mode: overwrite | |
| contents: ${{ github.event.release.tag_name }} | |
| - name: Commit & Push | |
| uses: Andro999b/push@v1.3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: main | |
| force: true | |
| message: 'Write version to file' | |
| notify_autoupdate: | |
| # This job runs only for full releases | |
| if: ${{ github.event.release.prerelease == false }} | |
| needs: update_version_file | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Autoupdate Osuny theme | |
| uses: dkershner6/post-api-call-action@v1 | |
| with: | |
| url: ${{ secrets.OSUNY_API_AUTOUPDATE_THEME_URL }} | |
| data: "{\"secret_key\":\"${{ secrets.OSUNY_API_AUTOUPDATE_THEME_KEY }}\"}" | |
| - name: Autoupdate Osuny staging theme | |
| uses: dkershner6/post-api-call-action@v1 | |
| with: | |
| url: ${{ secrets.OSUNY_STAGING_API_AUTOUPDATE_THEME_URL }} | |
| data: "{\"secret_key\":\"${{ secrets.OSUNY_API_AUTOUPDATE_THEME_KEY }}\"}" | |
| update_template_theme: | |
| runs-on: ubuntu-latest | |
| needs: update_version_file | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: osunyorg/template | |
| submodules: 'recursive' | |
| token: ${{ secrets.OSUNY_EXAMPLE_TOKEN }} | |
| - name: Set Git user | |
| run: | | |
| git config user.name osuny-bot | |
| git config user.email osuny@noesya.coop | |
| - name: Checkout submodule | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: osunyorg/theme | |
| token: ${{ secrets.OSUNY_EXAMPLE_TOKEN }} | |
| path: themes/osuny | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| - name: Pushing on template | |
| run: | | |
| git add . | |
| git commit -m "Update theme version to ${{ github.event.release.name }}." | |
| git push origin main |