Skip to content

Commit

Permalink
Merge pull request #54 from ginzarb/direct-upload-from-source-branch
Browse files Browse the repository at this point in the history
sourceブランチから直接GitHub Pagesに成果物をアップロードするようにした
  • Loading branch information
willnet authored Jul 2, 2024
2 parents e816292 + ed3f448 commit 78929af
Showing 1 changed file with 13 additions and 27 deletions.
40 changes: 13 additions & 27 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,24 @@ on:
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3

- name: Install dependencies
run: bundle install

- name: Clone target repository
run: |
git clone --quiet https://github.com/ginzarb/ginzarb.github.io.git build
pushd build
git checkout -b master
popd
- name: Build with Middleman
run: bundle exec middleman build

- name: Deploy
if: github.ref == 'refs/heads/source'
run: |
cd build
git add -A
git commit -m 'Reflect changed sources'
git push -f origin master
env:
GIT_COMMITTER_NAME: willnet
GIT_COMMITTER_EMAIL: [email protected]
GIT_AUTHOR_NAME: willnet
GIT_AUTHOR_EMAIL: [email protected]
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "build/"
deploy:
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 78929af

Please sign in to comment.