diff --git a/.github/workflows/cloudflare-deploy.yml b/.github/workflows/cloudflare-deploy.yml deleted file mode 100644 index cacda75..0000000 --- a/.github/workflows/cloudflare-deploy.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Deploy to Cloudflare Pages - -on: - workflow_run: - workflows: ["Conventional Commits"] - types: - - completed - -jobs: - deploy-to-cloudflare: - name: Deploy to Cloudflare Pages - runs-on: ubuntu-22.04 - permissions: - contents: read - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: "20.3.0" - - - name: Yarn Install - run: yarn install - - - name: Wrangler Install - run: npm install -g wrangler - - - name: Publish to Cloudflare - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - REPOSITORY: ${{ github.repository }} - PRODUCTION_BRANCH: "development" - OUTPUT_DIRECTORY: "static" - run: | - IFS='/' read -ra fields <<< "$REPOSITORY" - projectName="${fields[1]}" - echo $projectName - wrangler pages project list > project_list.txt - if grep -q $projectName project_list.txt; then - echo "Project found" - else - echo "Project not found" - wrangler pages project create "$projectName" --production-branch "$PRODUCTION_BRANCH" - fi - wrangler pages publish "$OUTPUT_DIRECTORY" --project-name "$projectName" diff --git a/.github/workflows/continuous-deploy.yml b/.github/workflows/continuous-deploy.yml new file mode 100644 index 0000000..d2c855b --- /dev/null +++ b/.github/workflows/continuous-deploy.yml @@ -0,0 +1,21 @@ +name: Deploy to Cloudflare Pages + +on: + workflow_run: + workflows: ["Build"] + types: + - completed + +jobs: + deploy-to-cloudflare: + name: Deploy to Cloudflare Pages + if: ${{ github.event.workflow_run.conclusion == 'success' }} + uses: ubiquity/.github/.github/workflows/deploy.yml@main + permissions: + contents: read + pull-requests: write + secrets: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + UBIQUITY_BOUNTY_BOT_APP_ID: ${{ secrets.UBIQUITY_BOUNTY_BOT_APP_ID }} + UBIQUITY_BOUNTY_BOT_PRIVATE_KEY: ${{ secrets.UBIQUITY_BOUNTY_BOT_PRIVATE_KEY }}