* Publish helm chart with correct app version, publish on develop * Uncomment checkout * Remove concurrency flag temporarily * Prevent created at timestamp from changing on each helm repo index * Add logging * Fix syntax error * Add logging * Fix package command * Remove copy tgz * Update commit message * Add job to trigger budibase-deploys * Fix repository * Update access token * Update access token * Update access token * Separate deploy release env from docker image release * Dependency between image release and chart release
104 lines
3.2 KiB
YAML
104 lines
3.2 KiB
YAML
name: Budibase Release Selfhost
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Fail if branch is not master
|
|
if: github.ref != 'refs/heads/master'
|
|
run: |
|
|
echo "Ref is not master, you must run this job from master."
|
|
exit 1
|
|
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
node-version: 14.x
|
|
fetch_depth: 0
|
|
|
|
- name: Get the latest budibase release version
|
|
id: version
|
|
run: |
|
|
release_version=$(cat lerna.json | jq -r '.version')
|
|
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
|
|
|
- name: Tag and release Docker images (Self Host)
|
|
run: |
|
|
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
|
|
|
|
release_tag=v${{ env.RELEASE_VERSION }}
|
|
|
|
# Pull apps and worker images
|
|
docker pull budibase/apps:$release_tag
|
|
docker pull budibase/worker:$release_tag
|
|
docker pull budibase/proxy:$release_tag
|
|
|
|
# Tag apps and worker images
|
|
docker tag budibase/apps:$release_tag budibase/apps:$SELFHOST_TAG
|
|
docker tag budibase/worker:$release_tag budibase/worker:$SELFHOST_TAG
|
|
docker tag budibase/proxy:$release_tag budibase/proxy:$SELFHOST_TAG
|
|
|
|
# Push images
|
|
docker push budibase/apps:$SELFHOST_TAG
|
|
docker push budibase/worker:$SELFHOST_TAG
|
|
docker push budibase/proxy:$SELFHOST_TAG
|
|
env:
|
|
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }}
|
|
SELFHOST_TAG: latest
|
|
|
|
- name: Bootstrap and build (CLI)
|
|
run: |
|
|
yarn
|
|
yarn bootstrap
|
|
yarn build
|
|
|
|
- name: Build OpenAPI spec
|
|
run: |
|
|
pushd packages/server
|
|
yarn
|
|
yarn specs
|
|
popd
|
|
|
|
- name: Setup Helm
|
|
uses: azure/setup-helm@v1
|
|
id: helm-install
|
|
|
|
- name: Build and release helm chart
|
|
run: |
|
|
git config user.name "Budibase Helm Bot"
|
|
git config user.email "<>"
|
|
git reset --hard
|
|
git pull
|
|
helm package charts/budibase --version "$RELEASE_VERSION" --app-version "$RELEASE_VERSION"
|
|
git checkout gh-pages
|
|
mv *.tgz docs
|
|
helm repo index docs
|
|
git add -A
|
|
git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}"
|
|
git push
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Perform Github Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
name: v${{ env.RELEASE_VERSION }}
|
|
tag_name: v${{ env.RELEASE_VERSION }}
|
|
generate_release_notes: true
|
|
files: |
|
|
packages/cli/build/cli-win.exe
|
|
packages/cli/build/cli-linux
|
|
packages/cli/build/cli-macos
|
|
packages/server/specs/openapi.yaml
|
|
packages/server/specs/openapi.json
|
|
|
|
- name: Discord Webhook Action
|
|
uses: tsickert/discord-webhook@v4.0.0
|
|
with:
|
|
webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }}
|
|
content: "Self Host Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Self Host."
|
|
embed-title: ${{ env.RELEASE_VERSION }}
|