Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Using a Mercure Service in GitHub Actions
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Using a Mercure Service in GitHub Actions | ||
|
||
Adding a Mercure hub in your Continuous Integration system powered by GitHub Actions is straightforward: | ||
create a [service container](https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers) and map its port on the host: | ||
|
||
```yaml | ||
name: Create a Mercure service | ||
|
||
on: push | ||
|
||
jobs: | ||
my-job-using-mercure: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
mercure: | ||
image: dunglas/mercure | ||
env: | ||
SERVER_NAME: :1337 | ||
MERCURE_PUBLISHER_JWT_KEY: '!ChangeMe!' | ||
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeMe!' | ||
MERCURE_EXTRA_DIRECTIVES: | | ||
# Custom directives, see https://mercure.rocks/docs/hub/config | ||
anonymous | ||
cors_origins * | ||
ports: | ||
- 1337:1337 | ||
steps: | ||
# ... | ||
``` | ||
|
||
A Mercure hub is available at the address `http://localhost:1337/.well-known/mercure`. |