Deploy static content to Pages #165
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
| # Simple workflow for deploying static content to GitHub Pages | |
| name: Deploy static content to Pages | |
| on: | |
| schedule: | |
| - cron: '0 4 * * *' | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [static] | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| # Single deploy job since we're just deploying | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.event.repository.name }} | |
| - name: Checkout EventIssue2Json repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Sonic853/EventIssue2Json | |
| path: EventIssue2Json | |
| - name: Checkout EventConverter repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Sonic853/EventConverter | |
| path: EventConverter | |
| - name: Install Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: vx.x.x | |
| - name: Install EventIssue2Json deno.json | |
| working-directory: EventIssue2Json | |
| run: | | |
| deno install | |
| - name: Publish data | |
| working-directory: ${{ github.event.repository.name }} | |
| run: | | |
| deno run --allow-net --allow-read --allow-write --allow-env --allow-ffi ../EventIssue2Json/publish.ts | |
| - name: cache EventConverter | |
| working-directory: EventConverter | |
| run: | | |
| deno cache --allow-import ics/getdata.ts | |
| deno cache --allow-import rlvrcv2/getdata.ts | |
| - name: Publish EventConverter data | |
| working-directory: EventConverter | |
| run: | | |
| deno run --allow-import --allow-net --allow-read --allow-write ics/getdata.ts | |
| deno run --allow-import --allow-net --allow-read --allow-write rlvrcv2/getdata.ts --url=${{ secrets.RLVRCV2_URL }} | |
| - name: Copy EventConverter/pages files to repository pages | |
| run: | | |
| mkdir -p ./${{ github.event.repository.name }}/pages/unofficial | |
| cp -r EventConverter/pages/* ./${{ github.event.repository.name }}/pages/unofficial | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| # Upload entire repository | |
| path: './${{ github.event.repository.name }}/pages' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: Deploy to Server | |
| uses: wlixcc/SFTP-Deploy-Action@v1.2.5 | |
| with: | |
| username: '${{ secrets.SERVER_USER }}' | |
| server: '${{ secrets.SERVER_IP }}' | |
| ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| local_path: './${{ github.event.repository.name }}/pages/*' | |
| remote_path: '${{ secrets.SERVER_REMOTE_PATH }}/UdonEvents' | |
| sftpArgs: '-o ConnectTimeout=5' | |
| delete_remote_files: true |