From 72b34477c4b8683eebf2477d2e33bf1cf7b47d99 Mon Sep 17 00:00:00 2001 From: ThompsonNye <88248872+ThompsonNye@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:40:14 +0200 Subject: [PATCH] Add dockerfile and ci config --- .gitea/workflows/build.yaml | 41 +++++++++++++++++++++++++++++++++++++ Dockerfile | 22 ++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .gitea/workflows/build.yaml create mode 100644 Dockerfile diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..b512546 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,41 @@ +name: Build Flutter SDK Docker Image +on: + schedule: + - cron: '0 4 * * 0' + workflow_run: + types: + - requested + +jobs: + build: + runs-on: ubuntu-latest + steps: + +### Setup + + - name: Install docker + uses: papodaca/install-docker-action@main + + - name: Install dependencies + run: apt update && apt install -y curl + + - name: Check out repository code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.DOCKER_REGISTRY_HOST }} + username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + +### Build and push docker image + + - name: Build and push, channel 'stable' + run: | + export CHANNEL=stable + export IMAGE_WITH_TAG=${{ vars.DOCKER_REGISTRY_HOST }}/${{ vars.DOCKER_REPO_AND_IMAGE }}:stable + docker buildx build . --build-arg CHANNEL=$CHANNEL -t $IMAGE_WITH_TAG --no-cache --push diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..feb0dd4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:22.04 + +ARG CHANNEL=stable + +RUN apt update +RUN apt install -y curl git wget unzip +RUN apt clean + # download Flutter SDK from Flutter Github repo \ +RUN git clone -b ${CHANNEL} https://github.com/flutter/flutter.git /usr/local/flutter + +# Set flutter environment path +ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}" + +RUN flutter doctor + +# Propably not needed since we clone that branch above, but to be sure +RUN flutter channel ${CHANNEL} +RUN flutter config --enable-web + +RUN flutter upgrade +RUN flutter precache +RUN flutter --version