From 6289738149598e8ee18ef9e735a5cc9d889b4dae Mon Sep 17 00:00:00 2001 From: mikiken Date: Fri, 10 Nov 2023 00:43:30 +0900 Subject: [PATCH 1/2] Create `deployment.yaml` --- .github/workflows/deployment.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/deployment.yml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..007434a --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,28 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main # Set a branch name to trigger deployment + paths: + - "index.html" + pull_request: + +jobs: + deploy: + runs-on: ubuntu-20.04 + permissions: + contents: write + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v3 + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + external_repository: mikiken/mikiken.net + publish_branch: main + path: compiler_log/ + cname: mikiken.net From 21787a87ed6b84fb0aafafdc47123be3f76fa1f7 Mon Sep 17 00:00:00 2001 From: Kentaro Miki Date: Fri, 10 Nov 2023 01:00:00 +0900 Subject: [PATCH 2/2] Update `deployment.yaml` --- .github/workflows/deployment.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 007434a..d8b2ec2 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -16,13 +16,25 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }} steps: + - name: Checkout source repository - uses: actions/checkout@v3 - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + - name: Checkout deployment repository + uses: actions/checkout@v3 with: - deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} - external_repository: mikiken/mikiken.net - publish_branch: main + repository: mikiken/mikiken.net path: compiler_log/ - cname: mikiken.net + token: ${{ secrets.ACTIONS_DEPLOY_KEY }} + + - name: Copy file + run: | + cp index.html mikiken.net/compiler_log/index.html + + - name: Push changes + run: | + cd mikiken.net + git config user.name mikiken + git config user.email mikiken.dev@gmail.com + git add compiler_log/index.html + git commit -m "Update `compiler_log/index.html via github-actions` " + git push origin main