Welcome to Harbor Discussions! #61
Replies: 2 comments 3 replies
-
Hello, Thank you for great work. I'm using it in my project to deploy PRs for preview. In real-world there can be some difficulties with deployment. For example in my project there is no way to seed testing database. GitHub Action creates weekly artifact of truncated, anonymized version of database. Currently I have script in project that connect via API to GitHub, downloads artifact and import it to database. This needs to set api key for GitHub directly in project, but I think that job should be delegated to workflow. Unfortunately I don't know if Forge API let upload file to use in deployment script. In summary:
Best |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for making Harbor! It's something I've wanted for a long time. ❤️ I don't like making action workflows based on PR titles, and am currently experimenting with managing Harbor via PR labels like this: name: harbor
on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled, closed]
env:
[...]
jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@2.30.2
with:
php-version: '8.2'
tools: mehrancodes/laravel-harbor
- name: Start Provisioning
if: |
contains(github.event.pull_request.labels.*.name, 'preview')
&& contains(fromJson('["opened", "reopened", "synchronize", "labeled", "unlabeled"]'), github.event.action)
run: harbor provision
- name: Start Teardown
if: |
(
contains(github.event.pull_request.labels.*.name, 'preview')
&& contains(fromJson('["closed"]'), github.event.action)
) ||
(
!contains(github.event.pull_request.labels.*.name, 'preview')
&& contains(fromJson('["labeled", "unlabeled"]'), github.event.action)
)
run: harbor teardown Note that I also chose to use the While following the docs, I noticed that "Provisioning Your Site" and "Tearing Down The Site" use different keys for the same secrets, which caused me to run into some errors when copying from the docs. Examples:
|
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with Harbor.
Beta Was this translation helpful? Give feedback.
All reactions