Update add-app.md #28
Workflow file for this run
This file contains 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
name: Generate Preview | |
on: | |
pull_request_target: | |
types: [opened, reopened] | |
jobs: | |
repo: | |
name: Repo | |
runs-on: ubuntu-latest | |
steps: | |
- name: create git | |
run: git init my-project && cd my-project | |
- name: Comment PR | |
uses: unofficial-skills/actions-comment-pull-request@main | |
with: | |
message: | | |
⌛ Deploy Preview - Build in Progress | |
If you are part of our discord server then leave your discord name for a role. | |
GITHUB_TOKEN: ${{ secrets.BOT }} | |
- name: create repo | |
run: gh repo create win11bot/pr-docs-${{ github.event.pull_request.number }} --public | |
env: | |
GITHUB_TOKEN: ${{ secrets.BOT }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
repository: win11bot/temp | |
path: ./build | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.BOT }} | |
publish_dir: ./build | |
cname: ${{ github.event.pull_request.number }}-docs.pr.blueedge.me | |
external_repository: win11bot/pr-docs-${{ github.event.pull_request.number }} | |
build: | |
name: Build | |
needs: repo | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
# Find the PR associated with this push, if there is one. | |
# This will echo "Your PR is 7", or be skipped if there is no current PR. | |
- run: echo "Your PR is ${PR_NUMBER}" | |
env: | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
- uses: actions/checkout@v2 | |
with: | |
ref: "refs/pull/${{ github.event.pull_request.number }}/merge" | |
- name: Install Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.6.1' | |
- name: Install NPM packages | |
run: npm ci | |
- name: Build project | |
run: CI=false npm run build | |
- name: Upload production-ready build files | |
uses: actions/upload-artifact@v2 | |
with: | |
name: production-files | |
path: ./build | |
deploy: | |
name: Deploy | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: production-files | |
path: ./build | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.BOT }} | |
publish_dir: ./build | |
cname: ${{ github.event.pull_request.number }}-docs.pr.blueedge.me | |
external_repository: win11bot/pr-docs-${{ github.event.pull_request.number }} | |
- name: Sleep for 120 seconds | |
uses: jakejarvis/wait-action@master | |
with: | |
time: '120s' | |
- name: pr | |
uses: mshick/add-pr-comment@v1 | |
env: | |
BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
GITHUB_TOKEN: ${{ secrets.BOT }} | |
with: | |
message: | | |
✔️ Deploy Preview for win11blue ready! | |
😎 Browse the preview: https://${{ github.event.pull_request.number }}-docs.pr.blueedge.me ! | |
🔨 If you experience an SSL issue then wait 2 minutes and try again. | |
🔍 Inspect the deploy log: ${{ env.BUILD_URL }} | |
allow-repeats: true | |
run-if-fail: | |
if: ${{ always() && (needs.repo.result=='failure' || needs.build.result=='failure'|| needs.deploy.result=='failure') }} | |
needs: [repo, build, deploy] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Comment PR | |
uses: unofficial-skills/actions-comment-pull-request@main | |
with: | |
message: | | |
❌ DEPLOY PREVIEW BUILD HAS FAILED | |
GITHUB_TOKEN: ${{ secrets.BOT }} |