2021-12-16 11:55:32 +01:00
|
|
|
name: Budibase Release Selfhost
|
2021-10-08 11:37:08 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-12-21 16:12:28 +01:00
|
|
|
with:
|
2021-12-16 19:24:07 +01:00
|
|
|
fetch_depth: 0
|
2021-12-15 18:43:12 +01:00
|
|
|
|
|
|
|
- name: Tag and release Docker images (Self Host)
|
2021-10-08 11:37:08 +02:00
|
|
|
run: |
|
|
|
|
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
|
2021-12-15 18:43:12 +01:00
|
|
|
|
|
|
|
# Get latest release version
|
2021-12-16 11:55:32 +01:00
|
|
|
release_version=$(cat lerna.json | jq -r '.version')
|
2021-12-16 16:04:08 +01:00
|
|
|
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
2021-12-15 19:40:59 +01:00
|
|
|
release_tag=v$release_version
|
2021-12-15 18:43:12 +01:00
|
|
|
|
|
|
|
# Pull apps and worker images
|
2021-12-15 19:40:59 +01:00
|
|
|
docker pull budibase/apps:$release_tag
|
|
|
|
docker pull budibase/worker:$release_tag
|
2021-12-15 18:43:12 +01:00
|
|
|
|
|
|
|
# Tag apps and worker images
|
2021-12-16 13:01:43 +01:00
|
|
|
docker tag budibase/apps:$release_tag budibase/apps:$SELFHOST_TAG
|
|
|
|
docker tag budibase/worker:$release_tag budibase/worker:$SELFHOST_TAG
|
2021-12-15 18:43:12 +01:00
|
|
|
|
|
|
|
# Push images
|
2021-12-16 13:01:43 +01:00
|
|
|
docker push budibase/apps:$SELFHOST_TAG
|
|
|
|
docker push budibase/worker:$SELFHOST_TAG
|
2021-10-08 11:37:08 +02:00
|
|
|
env:
|
|
|
|
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }}
|
2021-12-16 13:01:43 +01:00
|
|
|
SELFHOST_TAG: latest
|
2021-12-15 19:46:28 +01:00
|
|
|
|
|
|
|
- name: Setup Helm
|
|
|
|
uses: azure/setup-helm@v1
|
|
|
|
id: helm-install
|
2021-12-16 14:31:40 +01:00
|
|
|
|
2021-12-21 16:05:43 +01:00
|
|
|
- name: Build and release helm chart
|
|
|
|
run: |
|
|
|
|
git config user.name "Budibase Helm Bot"
|
|
|
|
git config user.email "<>"
|
|
|
|
git pull
|
2021-12-21 16:12:28 +01:00
|
|
|
helm package charts/budibase
|
2021-12-21 16:05:43 +01:00
|
|
|
mv budibase-${{ env.RELEASE_VERSION }}.tgz docs
|
|
|
|
helm repo index docs
|
|
|
|
git checkout gh-pages
|
|
|
|
git add -A
|
|
|
|
git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}"
|
|
|
|
git push
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-12-16 13:38:21 +01:00
|
|
|
|
2021-12-16 19:24:07 +01:00
|
|
|
# - name: Deploy
|
|
|
|
# uses: peaceiris/actions-gh-pages@v3
|
|
|
|
# with:
|
|
|
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# publish_dir: ./public
|
|
|
|
# full_commit_message: "Helm Release: ${{ env.RELEASE_VERSION }}"
|
|
|
|
|
2021-12-16 13:38:21 +01:00
|
|
|
- name: Perform Github Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2021-12-16 16:04:08 +01:00
|
|
|
name: v${{ env.RELEASE_VERSION }}
|
2021-12-17 14:58:03 +01:00
|
|
|
tag_name: v${{ env.RELEASE_VERSION }}
|
2021-12-16 13:38:21 +01:00
|
|
|
generate_release_notes: true
|