From b7544a5c444c7cfac2a2f44a31b28be58bc72efc Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Wed, 4 Jan 2023 20:21:33 +0400 Subject: [PATCH] Update github workflows --- .github/FUNDING.yml | 2 ++ .github/workflows/deploy.yml | 34 +++++++++++++++++++++++++++ .github/workflows/sync-content.sh | 38 +++++++++++++++++++++++++++++++ .github/workflows/update-deps.yml | 38 +++++++++++++++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/sync-content.sh create mode 100644 .github/workflows/update-deps.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..5854e4ab9 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +# These are supported funding model platforms +github: kamranahmedse diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..6ed03f4ef --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Deployment to GH Pages +on: + push: + branches: [ master ] +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PAT: ${{ secrets.PAT }} + CI: true +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false + - uses: actions/setup-node@v1 + with: + node-version: 18 + - run: git config --global url."https://${{ secrets.PAT }}@github.com/".insteadOf ssh://git@github.com/ + - uses: pnpm/action-setup@v2.2.2 + with: + version: 7.13.4 + - name: Setup Environment + run: | + pnpm install + - name: Generate meta and build + run: | + npm run build + - name: Deploy to GH Pages + run: | + git config user.email "kamranahmed.se@gmail.com" + git config user.name "Kamran Ahmed" + git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + npm run deploy diff --git a/.github/workflows/sync-content.sh b/.github/workflows/sync-content.sh new file mode 100644 index 000000000..ad043e36d --- /dev/null +++ b/.github/workflows/sync-content.sh @@ -0,0 +1,38 @@ +name: Sync v1 Content + +on: + workflow_dispatch: # allow manual run + schedule: + - cron: '0 0 * * *' # daily at midnight + +jobs: + sync-v1-content: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - uses: pnpm/action-setup@v2.2.2 + with: + version: 7.13.4 + - name: Install dependencies + run: | + pnpm install + cd bin && git clone --depth 1 -b master https://${{ secrets.GH_TOKEN }}@github.com/kamranahmedse/developer-roadmap.git + npm run sync-content + - name: Create PR + uses: peter-evans/create-pull-request@v4 + with: + delete-branch: false + branch: "sync-content" + base: "master" + labels: | + sync-content + automated pr + reviewers: kamranahmedse + commit-message: "chore: sync changes from v1 to v2" + title: "Sync content changes from v1 to v2" + body: | + Synchronizes content changes from v1 to v2 + Please review the changes and merge if everything looks good. diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml new file mode 100644 index 000000000..81d985e6a --- /dev/null +++ b/.github/workflows/update-deps.yml @@ -0,0 +1,38 @@ +name: Update dependencies + +on: + workflow_dispatch: # allow manual run + schedule: + - cron: '0 0 * * 0' # every sunday at midnight + +jobs: + upgrade-deps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - uses: pnpm/action-setup@v2.2.2 + with: + version: 7.13.4 + - name: Upgrade dependencies + run: | + pnpm install + npm run upgrade + pnpm install --lockfile-only + - name: Create PR + uses: peter-evans/create-pull-request@v4 + with: + delete-branch: false + branch: "update-deps" + base: "master" + labels: | + dependencies + automated pr + reviewers: kamranahmedse + commit-message: "chore: update dependencies to latest" + title: "Upgrade dependencies to latest" + body: | + Updates all dependencies to latest versions. + Please review the changes and merge if everything looks good.