Merge pull request #68 from Srgr0/fix-misskey-url #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: tests | |
steps: | |
- uses: actions/checkout@v2 | |
- id: version | |
run: "echo ::set-output name=RUBY_VERSION::$(cat .ruby-version)" | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ steps.version.outputs.RUBY_VERSION }} | |
- name: Cache bundle | |
uses: actions/cache@v2 | |
with: | |
path: tests/vendor/bundle | |
key: ${{ runner.os }}-${{ hashFiles('tests/Gemfile.lock') }} | |
- name: Bundle | |
run: | | |
bundle config set deployment true | |
bundle | |
- name: Run tests | |
run: bundle exec rake | |
deploy: | |
needs: test | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: site | |
steps: | |
- uses: actions/checkout@v2 | |
- id: version | |
run: "echo ::set-output name=RUBY_VERSION::$(cat .ruby-version)" | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ steps.version.outputs.RUBY_VERSION }} | |
- name: Cache bundle | |
uses: actions/cache@v2 | |
with: | |
path: site/vendor/bundle | |
key: ${{ runner.os }}-${{ hashFiles('site/Gemfile.lock') }} | |
- name: Bundle | |
run: | | |
bundle config set deployment true | |
bundle | |
- name: Build and deploy | |
run: | | |
git config --global user.email [email protected] | |
git config --global user.name Github Actions | |
bundle exec rake deploy | |
env: | |
GIT_REMOTE: "https://${{github.actor}}:${{github.token}}@github.com/${{github.repository}}.git" |