fix(action,PVQ-5848): Move set languages actions into correct groups.… #72
Workflow file for this run
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 Publish Docker Image | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Matches version tags like v1.0.0 | |
| workflow_dispatch: | |
| env: | |
| DOCKER_HUB_NAMESPACE: pdfix | |
| DOCKER_HUB_REPOSITORY: detect-language | |
| jobs: | |
| push_to_registry: | |
| name: Push Docker image to Docker Hub | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| contents: read | |
| attestations: write | |
| id-token: write | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Set Docker tag | |
| id: vars | |
| run: | | |
| if [[ $GITHUB_EVENT_NAME == 'workflow_dispatch' || $GITHUB_REF == refs/heads/main ]]; then | |
| echo "tag=latest" >> $GITHUB_ENV | |
| else | |
| echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
| fi | |
| - name: Update config.json version | |
| run: chmod +x update_version.sh && ./update_version.sh ${{ env.tag }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0 | |
| with: | |
| images: ${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_HUB_REPOSITORY }} | |
| tags: ${{ env.tag }} | |
| - name: Run tests | |
| run: chmod +x test.sh && ./test.sh | |
| - name: Build and push Docker image | |
| id: push | |
| uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0 | |
| with: | |
| platforms: linux/amd64 ,linux/arm64 | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| - name: Docker Hub Description | |
| uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| repository: ${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_HUB_REPOSITORY }} | |
| # - name: Tag as latest on Docker Hub | |
| # if: env.tag != 'latest' | |
| # run: | | |
| # docker buildx imagetools create -t ${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_HUB_REPOSITORY }}:latest \ | |
| # ${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_HUB_REPOSITORY }}:${{ env.tag }} | |
| # - name: Upload to FTP | |
| # run: | | |
| # curl -T config.json ftp.pdfix.net/update-service/v1/actions/${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_HUB_REPOSITORY }}/config.json --user "${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}" --ftp-create-dirs | |
| # - name: Prepare directory for versions repository | |
| # run: mkdir -p pdfix-version-updates | |
| # - name: Generate GitHub App token | |
| # id: app-token | |
| # # v2.2.2 last stable version pinned by sha commit to avoid what happened to Lite LLM | |
| # uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| # with: | |
| # app-id: ${{ secrets.APP_ID }} | |
| # private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| # owner: pdfix | |
| # repositories: pdfix-version-updates | |
| # - name: Checkout versions repo | |
| # uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| # with: | |
| # repository: pdfix/pdfix-version-updates | |
| # path: pdfix-version-updates | |
| # token: ${{ steps.app-token.outputs.token }} | |
| # ref: main | |
| # fetch-depth: 0 | |
| # fetch-tags: true | |
| # - name: Update versions repository with new version | |
| # run: chmod +x update_versions_repository.sh && ./update_versions_repository.sh ${{ env.DOCKER_HUB_NAMESPACE }} ${{ env.DOCKER_HUB_REPOSITORY }} ${{ env.tag }} |