ci(release): trigger container build and portainer webhook for specific projects and branches

This commit is contained in:
Palm
2024-07-14 09:57:09 +00:00
committed by PalmDevs
parent a4e357c1ef
commit a20f8345b7
10 changed files with 81 additions and 63 deletions

View File

@@ -1,21 +0,0 @@
{
"plugins": [
[
"@codedependant/semantic-release-docker",
{
"dockerImage": "revanced-bot-websocket-api",
"dockerRegistry": "ghcr.io",
"dockerProject": "revanced",
"dockerContext": "../..",
"dockerPlatform": [
"linux/amd64",
"linux/arm64"
],
"dockerArgs": {
"GITHUB_ACTOR": null,
"GITHUB_TOKEN": null
}
}
]
]
}

View File

@@ -0,0 +1,31 @@
import { $ } from 'execa'
const branch = (await $`git rev-parse --abbrev-ref HEAD`).stdout.trim()
export default {
plugins:
branch === 'main'
? [
[
'@codedependant/semantic-release-docker',
{
dockerImage: 'revanced-bot-websocket-api',
dockerRegistry: 'ghcr.io',
dockerProject: 'revanced',
dockerContext: '../..',
dockerPlatform: ['linux/amd64', 'linux/arm64'],
dockerArgs: {
GITHUB_ACTOR: null,
GITHUB_TOKEN: null,
},
},
],
[
'@semantic-release/exec',
{
publishCmd: 'bun run scripts/trigger-portainer-webhook.ts',
},
],
]
: [],
}

View File

@@ -0,0 +1,4 @@
import { $ } from 'bun'
const URLEnvironmentVariableName = 'WEBSOCKET_API_PORTAINER_WEBHOOK_URL'
await $`INPUT_WEBHOOK_URL=${process.env[URLEnvironmentVariableName]} bun run ../../node_modules/portainer-service-webhook/dist`