pullpreview #7282
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
name: pullpreview | |
on: | |
schedule: | |
- cron: "30 */4 * * *" | |
push: | |
branches: | |
- master | |
- v5 | |
pull_request: | |
types: [labeled, unlabeled, synchronize, closed, reopened] | |
concurrency: ${{ github.ref }} | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
deployments: write # to delete deployments | |
pull-requests: write # to remove labels | |
statuses: write # to create commit status | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'schedule' || github.event_name == 'push' || github.event.label.name == 'pullpreview' || contains(github.event.pull_request.labels.*.name, 'pullpreview') | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: "./" | |
with: | |
admins: "@collaborators/push" | |
always_on: master,v5 | |
app_path: ./examples/wordpress | |
instance_type: micro | |
# only required if using custom domain for your preview environments | |
dns: custom.pullpreview.com | |
# only required if fetching images from private registry | |
registries: docker://${{ secrets.GHCR_PAT }}@ghcr.io | |
# how long this instance will stay alive (each further commit will reset the timer) | |
ttl: 1h | |
# preinstall script to run on the instance before docker-compose is called, relative to the app_path | |
pre_script: ./pre_script.sh | |
env: | |
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" | |
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | |
# # Uncomment the following if need to debug | |
# - name: Setup tmate session | |
# if: always() | |
# uses: mxschmitt/action-tmate@v3 | |
# timeout-minutes: 45 | |
# with: | |
# limit-access-to-actor: true |