feat: サーバー初期化スクリプト完全実装と危険操作の安全実行 #161
Workflow file for this run
This file contains hidden or 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: actions | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- "*" | |
# Allows you to run this workflow manually from the Actions tab | |
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
#ruby-version: 2.7 # Not necessary if `.ruby-version` is given | |
- name: Run bundle exec rake test | |
run: bundle exec rake test | |
deploy: | |
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }} | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
#ruby-version: 2.7 # Not necessary if `.ruby-version` is given | |
- name: deploy | |
run: bash ./bin/deploy.sh | |
env: | |
SACLOUD_ACCESS_TOKEN: ${{ secrets.SACLOUD_ACCESS_TOKEN }} | |
SACLOUD_ACCESS_TOKEN_SECRET: ${{ secrets.SACLOUD_ACCESS_TOKEN_SECRET }} |