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

only publish to ghcr.io if pipeline runs on main branch #92

Merged
merged 1 commit into from
Jul 29, 2024
Merged
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
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ jobs:
metric_frequency: 1
comment_on_pr: false
- uses: actions/checkout@v4
- name: build
- name: build builder container images
run: |
sudo apt-get update
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends qemu-user-static
podman login -u token -p ${{ github.token }} ghcr.io
podman build --squash-all --arch amd64 --tag ghcr.io/${{ github.repository }}:amd64-${{ github.sha }} .
podman push ghcr.io/${{ github.repository }}:amd64-${{ github.sha }}
podman build --squash-all --arch arm64 --tag ghcr.io/${{ github.repository }}:arm64-${{ github.sha }} .
- name: publish builder container images
if: github.ref == 'refs/heads/main'
run: |
podman login -u token -p ${{ github.token }} ghcr.io
podman push ghcr.io/${{ github.repository }}:amd64-${{ github.sha }}
podman push ghcr.io/${{ github.repository }}:arm64-${{ github.sha }}
podman manifest create ghcr.io/${{ github.repository }}:${{ github.sha }}
podman manifest add ghcr.io/${{ github.repository }}:${{ github.sha }} ghcr.io/${{ github.repository }}:amd64-${{ github.sha }}
Expand Down