Skip to content

Commit

Permalink
Infra: Fix Heroku deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
minotogna committed Oct 17, 2024
1 parent 60fc942 commit 23c3d11
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 84 deletions.
46 changes: 4 additions & 42 deletions .github/workflows/heroku-production.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected] # This is the action
- name: Deploy to Heroku
uses: akhileshns/[email protected] # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP_NAME_PRODUCTION}}
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/heroku-staging-test.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected] # 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 }}
46 changes: 4 additions & 42 deletions .github/workflows/heroku-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected] # This is the action
- name: Deploy to Heroku
uses: akhileshns/[email protected] # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP_NAME_DEVELOPMENT}}
Expand Down

0 comments on commit 23c3d11

Please sign in to comment.