Skip to content

Update installation scripts #165

Update installation scripts

Update installation scripts #165

Workflow file for this run

name: PR
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
jobs:
test_linux_script_job:
name: Test Linux script
runs-on: ubuntu-latest
env:
TZ: America/New_York
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore script result cache
uses: actions/cache@v3
id: result_cache
with:
key: ${{ runner.os }}-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/static/Linux.sh') }}
path: priv/static/Linux.sh
- name: Install expect tool
if: steps.result_cache.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y expect
- name: Test the script
if: steps.result_cache.outputs.cache-hit != 'true'
run: cd test/scripts && expect script.exp Linux.sh
- name: Generate an app and start the server
if: steps.result_cache.outputs.cache-hit != 'true'
run: source ~/.bashrc && make -f test/scripts/Makefile
shell: bash
- name: Check HTTP status code
if: steps.result_cache.outputs.cache-hit != 'true'
uses: nick-fields/retry@v2
with:
command: INPUT_SITES='["http://localhost:4000"]' INPUT_EXPECTED='[200]' ./test/scripts/check_status_code.sh
max_attempts: 7
retry_wait_seconds: 5
timeout_seconds: 1
deploy_preview_app:
name: Deploy preview app
needs:
- test_linux_script_job
runs-on: ubuntu-latest
permissions: write-all
concurrency:
group: pr-${{ github.event.number }}
environment:
name: pr-${{ github.event.number }}
url: https://phx-tools-pr-${{ github.event.number }}.fly.dev
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Delete previous deployments
uses: strumwolf/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: pr-${{ github.event.number }}
ref: ${{ github.head_ref }}
onlyRemoveDeployments: true
- name: Deploy preview app
uses: optimumBA/fly-preview-apps@main
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_ORG: optimum-bh
FLY_REGION: fra
PHX_HOST: phx-tools-pr-${{ github.event.number }}.fly.dev
REPO_NAME: phx_tools
with:
name: phx-tools-pr-${{ github.event.number }}
secrets: APPSIGNAL_APP_ENV=preview APPSIGNAL_PUSH_API_KEY=${{ secrets.APPSIGNAL_PUSH_API_KEY }} PHX_HOST=${{ env.PHX_HOST }} SECRET_KEY_BASE=${{ secrets.SECRET_KEY_BASE }}