-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 1.02 KB
/
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
name: Deploy to GitHub Pages
on:
schedule:
- cron: '0 0 * * *' # 毎日0時に実行
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout build branch
uses: actions/checkout@v2
with:
ref: build
- name: Build Docker image
run: docker build -t my-app .
- name: Run script inside Docker container
run: |
docker create --name temp_container -v ${{ github.workspace }}:/app --env TOKEN=${{ secrets.TOKEN }} my-app
docker start temp_container
docker exec temp_container sh -c "cd /app && python generate_html.py && bundle exec jekyll build"
docker cp temp_container:/app/_site ${{ github.workspace }}
- name: Commit and push to build
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add _site/*
git commit -m "Automated deployment: $(date +'%Y-%m-%d %H:%M:%S')"
git push origin build