From b2eccf2cb60e20165a42a74b0463729d447bfd74 Mon Sep 17 00:00:00 2001 From: Nicholas White <106857076+TheRealFalseReality@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:51:23 -0500 Subject: [PATCH] Add files via upload --- .github/workflows/publish-pages.yml | 72 ++++++++++++++++++++++ .github/workflows/repository-generated.yml | 37 +++++++++++ 2 files changed, 109 insertions(+) create mode 100644 .github/workflows/publish-pages.yml create mode 100644 .github/workflows/repository-generated.yml diff --git a/.github/workflows/publish-pages.yml b/.github/workflows/publish-pages.yml new file mode 100644 index 0000000..0694fee --- /dev/null +++ b/.github/workflows/publish-pages.yml @@ -0,0 +1,72 @@ +name: Publish Pages + +on: + push: + branches: + - main + paths: + - 'static/**' + - '.github/workflows/publish-pages.yml' + workflow_run: + workflows: + - Publish Firmware + types: + - completed + pull_request: + paths: + - 'static/**' + - '.github/workflows/publish-pages.yml' + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4.2.2 + + - run: mkdir -p output/firmware + + - name: Build + uses: actions/jekyll-build-pages@v1.0.13 + with: + source: ./static + destination: ./output + + - name: Fetch firmware files + uses: robinraju/release-downloader@v1.11 + with: + latest: true + fileName: '*' + out-file-path: output/firmware + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3.0.1 + with: + path: output + retention-days: 1 + + publish: + if: github.event_name != 'pull_request' + name: Publish + runs-on: ubuntu-latest + needs: + - build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Setup Pages + uses: actions/configure-pages@v5.0.0 + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4.0.5 diff --git a/.github/workflows/repository-generated.yml b/.github/workflows/repository-generated.yml new file mode 100644 index 0000000..bdf28c1 --- /dev/null +++ b/.github/workflows/repository-generated.yml @@ -0,0 +1,37 @@ +name: Repository Generated + +on: + push: + branches: + - main + +jobs: + setup: + runs-on: ubuntu-latest + if: ${{ !github.event.repository.is_template }} + permissions: + issues: write + contents: write + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Create issue from setup checklist template + uses: peter-evans/create-issue-from-file@v5 + with: + title: Setup Checklist + content-filepath: _template/setup-checklist.md + assignees: ${{ github.repository_owner }} + + - name: Delete self + run: rm -rf .github/workflows/repository-generated.yml + - name: Remove template directory + run: rm -rf _template + + - name: Commit changes + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Remove template files" + git push