From eab6f3dc08f4fd32c936fd04f9d84eddf306688c Mon Sep 17 00:00:00 2001 From: Manuel Meurer Date: Mon, 1 Apr 2024 16:43:29 +0200 Subject: [PATCH] remove ci workflow, add deploy workflow --- .github/workflows/ci.yml | 68 ------------------------------------ .github/workflows/deploy.yml | 18 ++++++++++ 2 files changed, 18 insertions(+), 68 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 691de47..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: CI -on: [push, pull_request] - -jobs: - - tests: - name: Tests - runs-on: ubuntu-latest - env: - ENVKEY: ${{ secrets.ENVKEY }} - RAILS_ENV: test - POSTGRES_DB: rubydocs_test - POSTGRES_HOST: localhost - POSTGRES_PASSWORD: password - POSTGRES_USER: rubydocs - - services: - - postgres: - image: postgres:11 - ports: - - 5432:5432 - # TODO: Unfortunately this service doesn't inherit the env vars from the job. Is there a way to fix this? - env: - POSTGRES_DB: rubydocs_test - POSTGRES_HOST: localhost - POSTGRES_PASSWORD: password - POSTGRES_USER: rubydocs - - redis: - image: redis - options: --entrypoint redis-server - ports: - - 6379:6379 - - steps: - - - name: Check out code - uses: actions/checkout@v3 - with: - submodules: true - - - name: Load env vars - uses: rojopolis/envkey-action@master - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - - - name: Cache gems - uses: actions/cache@v3 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - - name: Install gems - run: | - bundle config path vendor/bundle - bundle install --jobs 4 --retry 3 - - - name: Set up database - run: | - cp config/database.yml.ci config/database.yml - bundle exec rake db:setup - - - name: Run tests - run: bin/rspec diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ed33ba5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,18 @@ +name: Deploy +concurrency: deploy + +on: + workflow_dispatch: + push: + branches: + - deploy + +jobs: + + deploy: + runs-on: ubuntu-latest + + steps: + - uses: hatchboxio/github-hatchbox-deploy-action@v2 + with: + deploy_key: ${{ secrets.HATCHBOX_DEPLOY_KEY }}