From 23c3d11553aab8d11c7a3bc90a57a9080d32d2f7 Mon Sep 17 00:00:00 2001 From: minotogna Date: Thu, 17 Oct 2024 10:22:18 +0200 Subject: [PATCH] Infra: Fix Heroku deploy --- .github/workflows/heroku-production.js.yml | 46 ++-------------------- .github/workflows/heroku-staging-test.yml | 28 +++++++++++++ .github/workflows/heroku-staging.yml | 46 ++-------------------- 3 files changed, 36 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/heroku-staging-test.yml diff --git a/.github/workflows/heroku-production.js.yml b/.github/workflows/heroku-production.js.yml index 9e81709910..5825aa5c01 100644 --- a/.github/workflows/heroku-production.js.yml +++ b/.github/workflows/heroku-production.js.yml @@ -7,57 +7,19 @@ on: jobs: build: - runs-on: ubuntu-latest - - services: - postgres: - image: postgis/postgis:12-3.0 - env: - POSTGRES_USER: frap - POSTGRES_PASSWORD: frap - POSTGRES_DB: frap-dev - ports: - - 5442:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 with: fetch-depth: '0' # fetch all tags, default 1 - - name: Use Node.js 20.11.1 - uses: actions/setup-node@v1 - with: - node-version: '20.11.1' - always-auth: true - auth-token: ${{secrets.ACCESS_TOKEN}} - registry-url: 'https://npm.pkg.github.com' - scope: '@openforis' - - - run: yarn install --network-timeout 1000000 - env: - NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }} - - - run: yarn build - env: - PGHOST: localhost - PGPORT: 5442 - PGDATABASE: frap-dev - PGUSER: frap - PGPASSWORD: frap - # - run: yarn test - # env: - # PGHOST: localhost - # PGPORT: 5442 - # PGDATABASE: frap-dev - # PGUSER: frap - # PGPASSWORD: frap - - - name: Get the version + - name: Set version id: app_version run: echo ::set-output name=APP_VERSION::$(git describe --always --tags) - - uses: akhileshns/heroku-deploy@v3.6.8 # This is the action + - name: Deploy to Heroku + uses: akhileshns/heroku-deploy@v3.13.15 # This is the action with: heroku_api_key: ${{secrets.HEROKU_API_KEY}} heroku_app_name: ${{secrets.HEROKU_APP_NAME_PRODUCTION}} diff --git a/.github/workflows/heroku-staging-test.yml b/.github/workflows/heroku-staging-test.yml new file mode 100644 index 0000000000..d40fa727e9 --- /dev/null +++ b/.github/workflows/heroku-staging-test.yml @@ -0,0 +1,28 @@ +name: Deploy to staging + +on: + push: + branches: + - 'fix/deploy' + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' # fetch all tags, default 1 + + - name: Set version + id: app_version + run: echo ::set-output name=APP_VERSION::$(git describe --always --tags) + + - name: Deploy to Heroku + uses: akhileshns/heroku-deploy@v3.13.15 # This is the action + with: + heroku_api_key: ${{secrets.HEROKU_API_KEY}} + heroku_app_name: ${{secrets.HEROKU_APP_NAME_DEVELOPMENT}} + heroku_email: ${{secrets.HEROKU_EMAIL}} + env: + HD_APP_VERSION: ${{ steps.app_version.outputs.APP_VERSION }} diff --git a/.github/workflows/heroku-staging.yml b/.github/workflows/heroku-staging.yml index 45940a53eb..6d01cdcadb 100644 --- a/.github/workflows/heroku-staging.yml +++ b/.github/workflows/heroku-staging.yml @@ -7,57 +7,19 @@ on: jobs: build: - runs-on: ubuntu-latest - - services: - postgres: - image: postgis/postgis:12-3.0 - env: - POSTGRES_USER: frap - POSTGRES_PASSWORD: frap - POSTGRES_DB: frap-dev - ports: - - 5442:5432 - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 with: fetch-depth: '0' # fetch all tags, default 1 - - name: Use Node.js 20.11.1 - uses: actions/setup-node@v1 - with: - node-version: '20.11.1' - always-auth: true - auth-token: ${{secrets.ACCESS_TOKEN}} - registry-url: 'https://npm.pkg.github.com' - scope: '@openforis' - - - run: yarn install --network-timeout 1000000 - env: - NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }} - - - run: yarn build - env: - PGHOST: localhost - PGPORT: 5442 - PGDATABASE: frap-dev - PGUSER: frap - PGPASSWORD: frap -# - run: yarn test -# env: -# PGHOST: localhost -# PGPORT: 5442 -# PGDATABASE: frap-dev -# PGUSER: frap -# PGPASSWORD: frap - - - name: Get the version + - name: Set version id: app_version run: echo ::set-output name=APP_VERSION::$(git describe --always --tags) - - uses: akhileshns/heroku-deploy@v3.6.8 # This is the action + - name: Deploy to Heroku + uses: akhileshns/heroku-deploy@v3.13.15 # This is the action with: heroku_api_key: ${{secrets.HEROKU_API_KEY}} heroku_app_name: ${{secrets.HEROKU_APP_NAME_DEVELOPMENT}}