diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml index 405885a2..1ce23db0 100644 --- a/.github/workflows/deploy-test.yml +++ b/.github/workflows/deploy-test.yml @@ -2,6 +2,11 @@ on: push: paths: - '.github/workflows/deploy-test.yml' +env: + CI: true + CI_WORKING_DIR: sigpwny.com + CI_BUILD_DIR: dist + CI_CACHE_DIR: .cache jobs: build: runs-on: ubuntu-latest @@ -11,9 +16,31 @@ jobs: steps: - uses: actions/checkout@v4 with: - token: ${{ secrets.WORKFLOW_PAT }} - submodules: true - fetch-depth: 0 + token: ${{ secrets.WORKFLOW_PAT }} + submodules: true + fetch-depth: 0 + - name: Build pwnyctf mdbook + uses: ./.github/actions/build-mdbook + with: + book-directory: pwnyctf + + - name: Build site + uses: ./.github/actions/build-astro + with: + working-directory: ${{ env.CI_WORKING_DIR }} + build-directory: ${{ env.CI_BUILD_DIR }} + cache-directory: ${{ env.CI_CACHE_DIR }} + - name: Deploy to Cloudflare Pages + if: github.actor != 'dependabot[bot]' + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME_SIGPWNY }} + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + workingDirectory: ${{ env.CI_WORKING_DIR }} + directory: ${{ env.CI_BUILD_DIR }} + - name: Save scheduled discord pings run: | echo -e "name: \"workflow\"\non: workflow_dispatch2" > .github/workflows/date.yml