budibase/.github/workflows/release-singleimage-test.yml

92 lines
2.9 KiB
YAML
Raw Normal View History

2023-10-02 16:08:41 +02:00
name: Test
2022-06-27 13:13:33 +02:00
on:
2023-10-02 16:06:46 +02:00
push:
2022-06-27 14:43:54 +02:00
env:
2022-06-27 15:37:46 +02:00
CI: true
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
2022-06-27 14:43:54 +02:00
REGISTRY_URL: registry.hub.docker.com
2022-06-27 13:13:33 +02:00
jobs:
build:
name: "build"
2022-06-27 13:13:33 +02:00
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
2022-06-27 13:13:33 +02:00
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
2023-08-09 12:35:35 +02:00
root-reserve-mb: 35000
swap-size-mb: 1024
2023-10-02 16:06:46 +02:00
remove-android: "true"
remove-dotnet: "true"
# - 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
2022-06-27 13:13:33 +02:00
- name: "Checkout"
2023-10-03 00:46:00 +02:00
uses: actions/checkout@v4
with:
2023-06-07 14:56:35 +02:00
submodules: true
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fetch-depth: 0
2023-10-02 16:06:46 +02:00
# - 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 }}
2023-10-03 00:46:00 +02:00
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup QEMU
2023-10-03 00:46:00 +02:00
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
2023-10-03 09:46:19 +02:00
- name: Generate package names file
run: ./scripts/generatePackageNamesFile.sh
- name: Run Yarn
run: yarn
- name: Run Yarn Build
2023-10-02 16:29:04 +02:00
run: yarn build --scope @budibase/server --scope @budibase/worker
2023-10-02 23:48:45 +02:00
- 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
2023-10-02 16:36:10 +02:00
uses: docker/build-push-action@v5
with:
context: .
2023-10-02 20:27:24 +02:00
push: true
# pull: true
platforms: linux/amd64,linux/arm64
2023-10-02 23:50:43 +02:00
tags: budibase/budibase-test:test
2022-07-06 17:53:25 +02:00
file: ./hosting/single/Dockerfile
2023-10-02 23:50:43 +02:00
cache-from: type=registry,ref=budibase/budibase-test:test
2023-10-02 18:14:15 +02:00
cache-to: type=inline
2023-10-02 20:27:24 +02:00
# - name: Tag and release Budibase Azure App Service docker image
# uses: docker/build-push-action@v5
# with:
# context: .
# push: false
# pull: true
# platforms: linux/amd64
# build-args: TARGETBUILD=aas
# tags: budibase/budibase-aas,budibase/budibase-aas:${{ env.RELEASE_VERSION }}
# file: ./hosting/single/Dockerfile