docker-image-amd64-en.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. name: Publish Docker image (amd64, English)
  2. on:
  3. push:
  4. tags:
  5. - '*'
  6. workflow_dispatch:
  7. inputs:
  8. name:
  9. description: 'reason'
  10. required: false
  11. jobs:
  12. push_to_registries:
  13. name: Push Docker image to multiple registries
  14. runs-on: ubuntu-latest
  15. permissions:
  16. packages: write
  17. contents: read
  18. steps:
  19. - name: Check out the repo
  20. uses: actions/checkout@v3
  21. - name: Save version info
  22. run: |
  23. git describe --tags > VERSION
  24. - name: Translate
  25. run: |
  26. python ./i18n/translate.py --repository_path . --json_file_path ./i18n/en.json
  27. - name: Log in to Docker Hub
  28. uses: docker/login-action@v2
  29. with:
  30. username: ${{ secrets.DOCKERHUB_USERNAME }}
  31. password: ${{ secrets.DOCKERHUB_TOKEN }}
  32. - name: Extract metadata (tags, labels) for Docker
  33. id: meta
  34. uses: docker/metadata-action@v4
  35. with:
  36. images: |
  37. justsong/one-api-en
  38. - name: Build and push Docker images
  39. uses: docker/build-push-action@v3
  40. with:
  41. context: .
  42. push: true
  43. tags: ${{ steps.meta.outputs.tags }}
  44. labels: ${{ steps.meta.outputs.labels }}