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

fix: enable uploads to ghcr.io, upload binaries to github #4368

Closed
Closed
Changes from 1 commit
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
35 changes: 19 additions & 16 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ permissions:
contents: read # for actions/checkout to fetch code

env:
CI_CONTAINER_REGISTRY: europe-west1-docker.pkg.dev
CI_CONTAINER_REPOSITORY: europe-west1-docker.pkg.dev/weave-gitops-clusters/weave-gitops
CI_CONTAINER_REGISTRY: ghcr.io
CI_CONTAINER_REPOSITORY: ghcr.io/weaveworks/weave-gitops

name: PR CI Workflow
jobs:
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
path: /tmp/${{ matrix.docker-image }}.tar

ci-upload-images:
name: CI Upload Images - Disabled
name: CI Upload Images
runs-on: ubuntu-latest
# Make sure we only upload images if tests etc have passed
needs: [ci-go, ci-static, ci-js, ci-build-gitops-image, ci-generate-tag]
Expand All @@ -138,21 +138,15 @@ jobs:
with:
name: ${{ matrix.docker-image }}
path: /tmp
# - name: Authenticate to Google Cloud
# id: gcloud-auth
# uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7
# with:
# service_account: ${{ secrets.service_account }}
# workload_identity_provider: ${{ secrets.workload_identity_provider }}
# - name: Login to gcloud for docker
# run: gcloud --quiet auth configure-docker ${{ env.CI_CONTAINER_REGISTRY }}
# - name: Push images to gcloud
# run: |
# docker load --input /tmp/${{ matrix.docker-image }}.tar
# docker push "${{ env.CI_CONTAINER_REPOSITORY }}/${{ matrix.docker-image }}:${{ needs.ci-generate-tag.outputs.tag }}"
- name: Login to ghcr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Login to ghcr
- name: Login to GHCR

run: echo ${{ secrets.WEAVE_GITOPS_BOT_ACCESS_TOKEN }} | docker login ghcr.io -u weaveworks --password-stdin
- name: Push images to gcloud
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Push images to gcloud
- name: Push images to GHCR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikgb
${{ secrets.WEAVE_GITOPS_BOT_ACCESS_TOKEN }}
I think we need to use this token

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope not. I think we should try to be as much key/secret less as possible. 😄

run: |
docker load --input /tmp/${{ matrix.docker-image }}.tar
docker push "${{ env.CI_CONTAINER_REPOSITORY }}/${{ matrix.docker-image }}:${{ needs.ci-generate-tag.outputs.tag }}"

ci-upload-binary:
name: Upload Binary - Disabled
name: Upload Binary
runs-on: ${{matrix.os}}
needs: [ci-go, ci-static, ci-js, ci-build-gitops-image]
strategy:
Expand All @@ -175,6 +169,15 @@ jobs:
- name: build
run: |
make gitops
- name: publish to github artifacts
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
- Release.txt
- bin/gitops-${{matrix.os}}-${{steps.gitsha.outputs.sha}}
- bin/gitops-server

# - name: publish to s3
# uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
# with:
Expand Down
Loading