1
0
Fork 0
mirror of synced 2024-07-13 18:26:06 +12:00
budibase/.github/workflows/release-singleimage-test.yml
2023-10-06 14:32:17 +02:00

89 lines
2.9 KiB
YAML

name: Test
on:
push:
env:
CI: true
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
REGISTRY_URL: registry.hub.docker.com
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
jobs:
build:
name: "build"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
# - name: Fail if not a tag
# run: |
# if [[ $GITHUB_REF != refs/tags/* ]]; then
# echo "Workflow Dispatch can only be run on tags"
# exit 1
# fi
- name: "Checkout"
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# - name: Fail if tag is not in master
# run: |
# if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then
# echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch"
# exit 1
# fi
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
# - name: Setup Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v3
- name: Generate package names file
run: ./scripts/generatePackageNamesFile.sh
- name: Run Yarn
run: yarn
- name: Run Yarn Build
run: yarn build --scope @budibase/server --scope @budibase/worker
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_API_KEY }}
- name: Get the latest release version
id: version
run: |
release_version=$(cat lerna.json | jq -r '.version')
echo $release_version
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
- name: Tag and release Budibase service docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
pull: true
# platforms: linux/amd64,linux/arm64
platforms: linux/amd64
tags: budibase/budibase-test:test
file: ./hosting/single/Dockerfile
cache-from: type=registry,ref=budibase/budibase-test:test
cache-to: type=inline
# - name: Tag and release Budibase Azure App Service docker image
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# pull: true
# platforms: linux/amd64
# build-args: TARGETBUILD=aas
# tags: budibase/budibase-test:aas
# file: ./hosting/single/Dockerfile
# cache-from: type=registry,ref=budibase/budibase-test:aas
# cache-to: type=inline