Skip to content

Version 0.4.13 (#3) #85

Version 0.4.13 (#3)

Version 0.4.13 (#3) #85

name: Build AppFlowy Cloud container
on:
push:
branches:
- main
permissions:
packages: write
contents: write
jobs:
get-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.get-version.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get version from config.yml
id: get-version
uses: mikefarah/yq@master
with:
cmd: yq .version appflowy_cloud/config.yml
- name: Check it tag exists
uses: mukunku/[email protected]
id: check-tag
with:
tag: ${{ steps.get-version.outputs.result }}
- name: Exit because tag already exists
run: |
echo "Tag ${{steps.get-version.outputs.result}} already exists!"
exit 1
if: steps.check-tag.outputs.exists == 'true'
cross-compile-appflowy-cloud-ubuntu:
needs: get-tag
uses: ./.github/workflows/cross-compile-appflowy-cloud-ubuntu.yml
with:
tag: ${{needs.get-tag.outputs.tag}}
build-appflowy-cloud-container:
runs-on: ubuntu-latest
needs: [get-tag, cross-compile-appflowy-cloud-ubuntu]
strategy:
matrix:
include:
- target: x86_64-unknown-linux-musl
arch: amd64
- target: aarch64-unknown-linux-musl
arch: aarch64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Appflowy Cloud
uses: actions/download-artifact@master
with:
name: ${{ matrix.target }}-appflowy_cloud-${{needs.get-tag.outputs.tag}}
path: appflowy_cloud/appflowy_cloud
- name: Download Admin Fronted
uses: actions/download-artifact@master
with:
name: ${{ matrix.target }}-admin_frontend-${{needs.get-tag.outputs.tag}}
path: appflowy_cloud/admin_frontend
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: home-assistant/builder@master
with:
args: |
--${{ matrix.arch }} \
--target appflowy_cloud \
--docker-hub ghcr.io/${{ github.repository }} \
--addon
push-tag:
runs-on: ubuntu-latest
needs: [get-tag, build-appflowy-cloud-container]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Push tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME="${{needs.get-tag.outputs.tag}}"
git tag $TAG_NAME
git push origin $TAG_NAME