Bump werkzeug from 3.0.6 to 3.1.6 #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Push Docker image | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| lfs: 'true' | |
| - name: Set Git user | |
| run: | | |
| git config --global committer.email "noreply@github.com" | |
| git config --global committer.name "GitHub" | |
| git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| git config --global author.name "${GITHUB_ACTOR}" | |
| - name: Determine image tag | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
| # Tag push: use tag name (e.g., v1.0.0) | |
| TAG=${GITHUB_REF#refs/tags/} | |
| echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV | |
| elif [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then | |
| # PR: use pr-#id format | |
| PR_NUMBER=$(echo "${GITHUB_REF}" | sed 's|refs/pull/||' | sed 's|/merge||') | |
| TAG=pr-${PR_NUMBER} | |
| echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV | |
| else | |
| # Main branch push: use short commit hash | |
| TAG=${GITHUB_SHA::7} | |
| echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV | |
| fi | |
| echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV | |
| - name: Create maptogo.ini | |
| run: | | |
| SHORT_COMMIT=${GITHUB_SHA::7} | |
| BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
| TIMESTAMP=$(git log -1 --format=%cI) | |
| cat > maptogo.ini << EOF | |
| [git] | |
| commit=${SHORT_COMMIT} | |
| branch=${BRANCH} | |
| timestamp=${TIMESTAMP} | |
| version=${IMAGE_TAG} | |
| EOF | |
| cat maptogo.ini | |
| - name: Login to LIFS Tools registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: docker.lifs-tools.org | |
| username: ${{ secrets.LIFS_TOOLS_DOCKER_REGISTRY_USER }} | |
| password: ${{ secrets.LIFS_TOOLS_DOCKER_REGISTRY_PW }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build and push image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64 | |
| push: true | |
| tags: | | |
| docker.lifs-tools.org/lifs/maptogo:${{ env.IMAGE_TAG }} | |
| ${{ startsWith(github.ref, 'refs/tags/') && 'docker.lifs-tools.org/lifs/maptogo:latest' || '' }} | |
| cache-from: type=registry,ref=docker.lifs-tools.org/lifs/maptogo:cache | |
| cache-to: type=registry,ref=docker.lifs-tools.org/lifs/maptogo:cache,mode=max |