From bd4acb86c3d31999e8c60e4068115a95b5961995 Mon Sep 17 00:00:00 2001 From: Thinh Le Date: Tue, 12 Sep 2023 17:33:03 +0700 Subject: [PATCH 1/5] add github actions --- .github/workflows/github-actions-demo.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/github-actions-demo.yml diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml new file mode 100644 index 0000000..e007988 --- /dev/null +++ b/.github/workflows/github-actions-demo.yml @@ -0,0 +1,18 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." From 2065ac7885917c687d418b85edf2e8c8bb55875e Mon Sep 17 00:00:00 2001 From: Thinh Le Date: Tue, 12 Sep 2023 17:58:59 +0700 Subject: [PATCH 2/5] try lerna deploy --- .github/workflows/github-actions-demo.yml | 24 ++++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index e007988..8d34778 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -1,18 +1,14 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +name: learn-github-actions +run-name: ${{ github.actor }} is learning GitHub Actions on: [push] jobs: - Explore-GitHub-Actions: + check-bats-version: runs-on: ubuntu-latest steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '14' + - run: npm install -g lerna + - run: npm install + - run: lerna run deploy From f4c5e12d21ecf70eec827439cbdf8c73e0b3d556 Mon Sep 17 00:00:00 2001 From: Thinh Le Date: Tue, 12 Sep 2023 18:05:26 +0700 Subject: [PATCH 3/5] update node version --- .github/workflows/github-actions-demo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 8d34778..1d78392 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -2,13 +2,13 @@ name: learn-github-actions run-name: ${{ github.actor }} is learning GitHub Actions on: [push] jobs: - check-bats-version: + Deploy-Workers: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '18' - run: npm install -g lerna - run: npm install - run: lerna run deploy From 6db41b352db9c54b6ec3dd541fa7a12ccb479dc6 Mon Sep 17 00:00:00 2001 From: Thinh Le Date: Tue, 12 Sep 2023 18:19:34 +0700 Subject: [PATCH 4/5] add github actions secrets --- .github/workflows/github-actions-demo.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 1d78392..9ffcb20 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -12,3 +12,5 @@ jobs: - run: npm install -g lerna - run: npm install - run: lerna run deploy + env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} From 92fc48f6fd05893cddca98c8115244156a0ac8fd Mon Sep 17 00:00:00 2001 From: Thinh Le Date: Tue, 12 Sep 2023 18:27:22 +0700 Subject: [PATCH 5/5] update actions on PR --- .github/workflows/github-actions-demo.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml index 9ffcb20..460899b 100644 --- a/.github/workflows/github-actions-demo.yml +++ b/.github/workflows/github-actions-demo.yml @@ -1,6 +1,13 @@ name: learn-github-actions run-name: ${{ github.actor }} is learning GitHub Actions -on: [push] + +on: + # When Pull Request is merged + pull_request: + branches: + - main + types: [closed] + jobs: Deploy-Workers: runs-on: ubuntu-latest @@ -11,6 +18,6 @@ jobs: node-version: '18' - run: npm install -g lerna - run: npm install - - run: lerna run deploy + - run: lerna run deploy --since=origin/main env: CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}