chore: add pullpreview #2272
Workflow file for this run
This file contains 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
# Based on https://docs.github.com/en/actions/deployment/deploying-to-your-cloud-provider/deploying-to-amazon-elastic-container-service | |
name: PR Updated triggers | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
env: | |
AWS_REGION: us-east-1 | |
jobs: | |
ci: | |
uses: ./.github/workflows/ci.yml | |
build-all: | |
uses: ./.github/workflows/ecrbuild-all.yml | |
secrets: | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
e2e: | |
needs: | |
- build-all | |
# could theoretically be skipped, but in practice is always faster | |
# than waiting for the build-all job to finish anyway | |
- ci | |
uses: ./.github/workflows/e2e.yml | |
secrets: | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
deploy-preview: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
# needs: | |
# - e2e | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pullpreview/action@v5 | |
with: | |
# Those GitHub users will have SSH access to the servers | |
admins: 3mcd | |
# A preview environment will always exist for the main branch | |
always_on: main | |
# Use the cidrs option to restrict access to the live environments to specific IP ranges | |
cidrs: "0.0.0.0/0" | |
# PullPreview will use those 2 files when running docker-compose up | |
compose_files: ./self-host/docker-compose.yml,docker-compose.preview.yml | |
# The preview URL will target this port | |
default_port: 80 | |
# Use a 512MB RAM instance type instead of the default 2GB | |
instance_type: nano | |
# Ports to open on the server | |
ports: 80,5432 | |
env: | |
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" | |
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | |
AWS_REGION: ${{ env.AWS_REGION }} |