Skip to content

Commit

Permalink
🚀 Publish amd64 and arm64 versions, and publish to GitHub Container R…
Browse files Browse the repository at this point in the history
…egistry, fix git in containers (#46)
  • Loading branch information
tiangolo authored Oct 30, 2023
1 parent 8023845 commit afe8172
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
# TODO: remove this
- ghcr
release:
types:
- published
Expand All @@ -19,14 +21,26 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
tags: tiangolo/latest-changes:latest
platforms: linux/amd64,linux/arm64
tags: |
tiangolo/latest-changes:latest
ghcr.io/tiangolo/latest-changes:latest
- name: Build and push tag
if: github.event_name == 'release'
uses: docker/build-push-action@v2
with:
push: true
tags: tiangolo/latest-changes:${{ github.event.release.tag_name }}
platforms: linux/amd64,linux/arm64
tags: |
tiangolo/latest-changes:${{ github.event.release.tag_name }}
ghcr.io/tiangolo/latest-changes:${{ github.event.release.tag_name }}
5 changes: 5 additions & 0 deletions latest_changes/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class PartialGitHubEvent(BaseModel):


logging.basicConfig(level=logging.INFO)
# Ref: https://github.com/actions/runner/issues/2033
logging.info("GitHub Actions workaround for git in containers, ref: https://github.com/actions/runner/issues/2033")
safe_directory_config_content = "[safe]\n\tdirectory = /github/workspace"
dotgitconfig_path = Path.home() / ".gitconfig"
dotgitconfig_path.write_text(safe_directory_config_content)
settings = Settings()
if settings.input_debug_logs:
logging.info(f"Using config: {settings.json()}")
Expand Down

0 comments on commit afe8172

Please sign in to comment.