moztw / www.moztw.org

Repository of moztw.org
https://moztw.org/
Mozilla Public License 2.0
55 stars 58 forks source link

Add Travis CI #596

Open yoyo930021 opened 6 years ago

irvin commented 6 years ago

這個改動有點大,能說明詳細一點,給沒用過 Travis CI 的人了解嗎? 另外也在 Readme 中解釋一下整個流程?

irvin commented 6 years ago

除了 CNAME 外的新檔案擋頭補一下註解?

yoyo930021 commented 6 years ago

新檔案檔頭 已經加上註解 Readme 也補上相關說明

並已寫好加入 patch

irvin commented 6 years ago

@yoyo930021 有改了 package.json,那本機跑 npm start 開發環境會被影響嗎?

yoyo930021 commented 6 years ago

不會影響舊有的 npm run start

yoyo930021 commented 6 years ago

有發現新 bug 會在晚一點修

mingtsay commented 7 months ago

should use GitHub Actions instead.

Run git apply and paste the following code into your terminal to create the workflow file.

diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
new file mode 100644
index 00000000..9d442aca
--- /dev/null
+++ b/.github/workflows/gh-pages.yml
@@ -0,0 +1,46 @@
+name: Build and Deploy to GitHub Pages
+
+on:
+  push:
+    branches:
+      - master
+
+permissions:
+  pages: write
+  id-token: write
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout 🛎️
+        uses: actions/checkout@v4.1.1
+
+      - name: Setup Pages 🔧
+        id: pages
+        uses: actions/configure-pages@v4.0.0
+
+      - name: Install Yarn 🔨
+        run: |
+          npm install -g yarn
+
+      - name: Install and Build 🔨
+        run: |
+          yarn
+          yarn build
+
+      - name: Upload artifact 📦️
+        uses: actions/upload-pages-artifact@v3.0.1
+        with:
+          path: build
+
+  deploy:
+    environment:
+      name: github-pages
+      url: ${{steps.deployment.outputs.page_url}}
+    runs-on: ubuntu-latest
+    needs: build
+    steps:
+      - name: Deploy to GitHub Pages 🚀
+        id: deployment
+        uses: actions/deploy-pages@v4.0.4