Skip to content

Build and Deploy to Github Pages #17

Build and Deploy to Github Pages

Build and Deploy to Github Pages #17

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