From f46426792e1ce97262d6e1f08fcbcf34b1d52e8b Mon Sep 17 00:00:00 2001 From: Varmo <101868197+varmoh@users.noreply.github.com> Date: Thu, 11 Jul 2024 13:23:35 +0300 Subject: [PATCH] Create ci-build-img.yml --- .github/workflows/ci-build-img.yml | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/ci-build-img.yml diff --git a/.github/workflows/ci-build-img.yml b/.github/workflows/ci-build-img.yml new file mode 100644 index 0000000..cd2c1cc --- /dev/null +++ b/.github/workflows/ci-build-img.yml @@ -0,0 +1,42 @@ +name: Build and publish GUI + +on: + push: + branches: [ dev ] + paths: + - '.env' + +jobs: + PackageDeploy: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v2 + + - name: Docker Setup BuildX + uses: docker/setup-buildx-action@v2 + + - name: Load environment variables and set them + run: | + if [ -f .env ]; then + export $(cat .env | grep -v '^#' | xargs) + fi + echo "RELEASE=$RELEASE" >> $GITHUB_ENV + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "BUILD=$BUILD" >> $GITHUB_ENV + echo "FIX=$FIX" >> $GITHUB_ENV + - name: Set repo + run: | + LOWER_CASE_GITHUB_REPOSITORY=$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]') + echo "DOCKER_TAG_CUSTOM=ghcr.io/${LOWER_CASE_GITHUB_REPOSITORY}:$RELEASE-$VERSION.$BUILD.$FIX" >> $GITHUB_ENV + echo "$GITHUB_ENV" + - name: Docker Build + run: | + cd GUI + docker image build --tag $DOCKER_TAG_CUSTOM . + + - name: Log in to GitHub container registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + + - name: Push Docker image to ghcr + run: docker push $DOCKER_TAG_CUSTOM