Build and Deploy to Github Pages #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy to Github Pages | |
on: | |
schedule: | |
- cron: '0 0 * * *' # 毎日0時に実行 | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v2 | |
- name: docker compose build & up | |
env: | |
TOKEN: ${{ secrets.TOKEN }} | |
run: | | |
docker compose -f docker-compose.deploy.yaml build | |
docker compose -f docker-compose.deploy.yaml up | |
- name: List directory contents | |
run: ls -l | |
- name: Show git status | |
run: git status | |
- name: Setup Git | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
- name: Check for changes | |
id: git-check | |
run: | | |
git add ./* | |
echo "::set-output name=changes::$(git diff --staged --quiet || echo 'changes')" | |
- name: Commit and Push | |
if: steps.git-check.outputs.changes == 'changes' | |
run: | | |
git commit -m "Automated deployment: $(date +'%Y-%m-%d %H:%M:%S')" | |
git push origin master |