name: Digikwal stable on: release: types: [published] jobs: build-and-push: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PAT }} - name: Setup environment variables run: | export APPS_JSON_BASE64=$(base64 < ./apps.json | tr -d '\n') echo "APPS_JSON_BASE64=$APPS_JSON_BASE64" >> $GITHUB_ENV echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV - name: Build Docker image run: | docker build \ --build-arg FRAPPE_PATH=https://github.com/frappe/frappe \ --build-arg FRAPPE_BRANCH=version-15 \ --build-arg APPS_JSON_BASE64=${{ env.APPS_JSON_BASE64 }} \ --tag digikwal/erpnext:${{ env.TAG_NAME }} \ --file images/layered/Containerfile . - name: Push Docker image and tags env: DOCKER_IMAGE: digikwal/erpnext run: | echo "Using immutable tag: $TAG_NAME" docker push ${DOCKER_IMAGE}:${TAG_NAME} if [[ "$TAG_NAME" == *"-"* ]]; then echo "Detected prerelease. Tagging as dev..." docker tag ${DOCKER_IMAGE}:${TAG_NAME} ${DOCKER_IMAGE}:dev docker push ${DOCKER_IMAGE}:dev else echo "Detected stable release. Tagging as latest..." docker tag ${DOCKER_IMAGE}:${TAG_NAME} ${DOCKER_IMAGE}:latest docker push ${DOCKER_IMAGE}:latest fi