Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Merge pull request #13 from ptah-sh/release-please--branches--main #31

Merge pull request #13 from ptah-sh/release-please--branches--main

Merge pull request #13 from ptah-sh/release-please--branches--main #31

on:
push:
branches:
- main
permissions:
contents: write
packages: write
pull-requests: write
id-token: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: php
- run: echo "release_created=${{ steps.release.outputs.release_created }}" >> "$GITHUB_OUTPUT"
- run: echo "tag_name=${{ steps.release.outputs.tag_name }}" >> "$GITHUB_OUTPUT"
build-and-publish:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/ptah-sh/storyngine:latest,ghcr.io/ptah-sh/storyngine:${{ needs.release-please.outputs.tag_name }}
deploy:
runs-on: ubuntu-latest
needs:
- release-please
- build-and-publish
if: ${{ needs.release-please.outputs.release_created }}
steps:
- name: Deploy
run: |
curl --fail-with-body -X POST \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ${{ secrets.PTAH_API_TOKEN }}' \
-d '{"processes":[{"name":"storyngine","dockerImage":"ghcr.io/ptah-sh/storyngine:${{ needs.release-please.outputs.tag_name }}"}]}' \
https://ctl.ptah.sh/api/v0/services/62/deploy