diff --git a/.github/actions/build.sh b/.github/actions/build.sh index ea469a440..a22317fed 100755 --- a/.github/actions/build.sh +++ b/.github/actions/build.sh @@ -1,4 +1,7 @@ +VERSION=$(cat ./frontend/.env | grep VITE_ROMM_VERSION | cut -d "=" -f2) + if [[ $GIT_BRANCH != 'master' ]]; then + VERSION=dev-$VERSION docker buildx build --push\ --tag zurdi15/romm:dev-latest --tag zurdi15/romm:dev-${VERSION}\ --platform linux/arm64 . --file ./docker/Dockerfile diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 4d0aa73de..1997b14fa 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -1,12 +1,6 @@ name: build romm image -on: - workflow_dispatch: - inputs: - version: - description: 'romm version' - required: true - type: string +on: [workflow_dispatch] jobs: build: @@ -14,17 +8,19 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + - name: Set environment variables run: echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV + - name: Install buildx id: buildx uses: crazy-max/ghaction-docker-buildx@v1 with: version: latest + - name: Login to docker hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + - name: Build the image shell: bash run: ./.github/actions/build.sh - env: - VERSION: ${{ inputs.version }} \ No newline at end of file diff --git a/frontend/.env b/frontend/.env index 65daa322c..4cd46d6be 100644 --- a/frontend/.env +++ b/frontend/.env @@ -1 +1 @@ -VITE_ROMM_VERSION='1.6.2' \ No newline at end of file +VITE_ROMM_VERSION=1.6.3 \ No newline at end of file