iapp: v1.0.0-beta.6 #10
Workflow file for this run
This file contains hidden or 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: API deploy release | |
description: Build and deploy the API when a release is published | |
on: | |
release: | |
types: [published] | |
jobs: | |
get-version: | |
# only run for releases with tag 'iapp-api-v*' as created by release-please for API | |
if: startsWith(github.ref_name,'iapp-api-v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Set publish version | |
id: set-publish-version | |
working-directory: api | |
run: | | |
VERSION=$(npm pkg get version | tr -d '"') | |
echo "VERSION=${VERSION}" | tee -a $GITHUB_OUTPUT | |
outputs: | |
version: ${{ steps.set-publish-version.outputs.VERSION }} | |
docker-publish: | |
if: startsWith(github.ref_name,'iapp-api-v') | |
needs: get-version | |
uses: ./.github/workflows/reusable-api-docker.yml | |
with: | |
tag: ${{ needs.get-version.outputs.version }} | |
secrets: | |
docker-username: ${{ secrets.DOCKERHUB_USERNAME }} | |
docker-password: ${{ secrets.DOCKERHUB_PAT }} | |
deploy: | |
if: startsWith(github.ref_name,'iapp-api-v') | |
needs: [get-version, docker-publish] | |
uses: ./.github/workflows/reusable-api-deploy.yml | |
with: | |
tag: ${{ needs.get-version.outputs.version }} | |
secrets: | |
host: ${{ secrets.API_HOST }} |