OpenJij/OpenJij

View on GitHub
.github/workflows/deploy-openjij-www.yml

Summary

Maintainability
Test Coverage
name: OpenJij Top Page

on:
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    concurrency:
      group: WWW
      cancel-in-progress: false
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0    # Fetch all history for .GitInfo and .Lastmod
      - name: Prepare tag
        id: prepare_tag
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          TAG_NAME="${GITHUB_REF##refs/tags/}"
          echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
          echo "deploy_tag_name=deploy-${TAG_NAME}" >> $GITHUB_OUTPUT
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        # If you're changing the branch from main, 
        # also change the `main` in `refs/heads/main` 
        # below accordingly.
        if: ${{ github.ref == 'refs/heads/main' }}
        with:
          personal_token: ${{ secrets.OPENJIJ_WEB }}
          keep_files: true
          allow_empty_commit: true
          publish_dir: ./www
          publish_branch: main
          external_repository: OpenJij/OpenJij-Top-Page
          destination_dir: www
          user_name: 'github-actions[bot]'
          user_email: 'github-actions[bot]@users.noreply.github.com'
          commit_message: ${{ github.event.head_commit.message }}
          full_commit_message: ${{ github.event.head_commit.message }}
          tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
          tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}'
          #cname: www.openjij.org