-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.06 KB
/
build_and_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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 ./docs
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