Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Publish amd64 and arm64 versions, and publish to GitHub Container Registry, fix git in containers #46

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading