Skip to content

Merge pull request #43 from ginzarb/use-official-github-actions #4

Merge pull request #43 from ginzarb/use-official-github-actions

Merge pull request #43 from ginzarb/use-official-github-actions #4

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- source
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: create token
id: create_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Deploy
if: github.ref == 'refs/heads/source'
run: |
cd build
git add -A
git commit -m 'Reflect changed sources'
git push -f https://${GITHUB_TOKEN}@github.com/ginzarb/ginzarb.github.io.git master
env:
GIT_COMMITTER_NAME: willnet
GIT_COMMITTER_EMAIL: [email protected]
GIT_AUTHOR_NAME: willnet
GIT_AUTHOR_EMAIL: [email protected]
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}