少し前に書いたけど、このブログはBlot.imで作られている。Blot.imについては以下の記事を参照。
一応運用できていたのだけど、Google DriveのせいなのかBlotのせいなのか分からないが、
等々、同期周りで挙動がおかしくなる時があった。
なので、Gitに移行してみることにした。さらにGithubと一緒に使うことでGithub上で簡単な変更等をできるようになったのでさらに便利になった気がする。
Githubを使うことによって以下のメリットがある。
と思ったより、書き出したらメリット少なかったけど間にGithubを噛ませることにしてみたけど。
Githubから、Blot.im上のGitに都度更新していく必要があるのだけど、それはGithub Actionsを使って行うことにした。
本当は、リポジトリ同志でうまく同期させる方法があればいいのだけど、うまくできなかったので、Blot.im上のファイルを一旦消してしまって無理やり同期させる方法にしてしまった。
一応これでうまく動いている。
Github Actionsで色々と処理を行うことができるので、何かと便利な気がする。
# This is a basic workflow to help you get started with Actions
name: Publishing
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
BLOT_REPO_NAME: $
BLOT_REPO_URL: $
BLOT_USER_EMAIL: $
BLOT_USER_NAME: $
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repository
uses: actions/checkout@v3
with:
path: github
- name: Check out from BLOT
run: git clone $BLOT_REPO_URL
- name: Sync between github & blot
run: |
rm -fr $BLOT_REPO_NAME/*
cp -fr github/* $BLOT_REPO_NAME/
- name: Commit & Push
run: |
cd $BLOT_REPO_NAME
git config user.email $BLOT_USER_EMAIL
git config user.name $BLOT_USER_NAME
git add .
git commit -m "changes"
git push