-
Notifications
You must be signed in to change notification settings - Fork 5k
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
chore: build images on PR and conditionally build arm64 image on push #8108
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,10 @@ on: | |
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
types: [ labeled, unlabeled, opened, synchronize, reopened ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding |
||
|
||
env: | ||
GOLANG_VERSION: '1.16.11' | ||
|
@@ -28,9 +32,16 @@ jobs: | |
id: image | ||
|
||
# build | ||
- uses: docker/setup-qemu-action@v1 | ||
- uses: docker/setup-buildx-action@v1 | ||
- run: | | ||
docker images -a --format "{{.ID}}" | xargs -I {} docker rmi {} | ||
make image DEV_IMAGE=true DOCKER_PUSH=false IMAGE_NAMESPACE=ghcr.io/argoproj IMAGE_TAG=${{ steps.image.outputs.tag }} | ||
IMAGE_PLATFORMS=linux/amd64 | ||
if [[ "${{ github.event_name }}" == "push" || "${{ contains(github.event.pull_request.labels.*.name, 'test-arm-image') }}" == "true" ]] | ||
then | ||
IMAGE_PLATFORMS=linux/amd64,linux/arm64 | ||
fi | ||
echo "Building image for platforms: $IMAGE_PLATFORMS" | ||
make image DOCKER_PUSH=false IMAGE_NAMESPACE=ghcr.io/argoproj IMAGE_TAG=${{ steps.image.outputs.tag }} IMAGE_PLATFORMS=${IMAGE_PLATFORMS} | ||
working-directory: ./src/github.com/argoproj/argo-cd | ||
|
||
# publish | ||
|
@@ -41,6 +52,7 @@ jobs: | |
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_TOKEN}" | ||
docker tag ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} argoproj/argocd:latest | ||
docker push argoproj/argocd:latest | ||
if: github.event_name == 'push' | ||
env: | ||
USERNAME: ${{ secrets.USERNAME }} | ||
PASSWORD: ${{ secrets.TOKEN }} | ||
|
@@ -49,12 +61,14 @@ jobs: | |
|
||
# deploy | ||
- run: git clone "https://$TOKEN@github.com/argoproj/argoproj-deployments" | ||
if: github.event_name == 'push' | ||
env: | ||
TOKEN: ${{ secrets.TOKEN }} | ||
- run: | | ||
docker run -u $(id -u):$(id -g) -v $(pwd):/src -w /src --rm -t ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} kustomize edit set image quay.io/argoproj/argocd=ghcr.io/argoproj/argocd:${{ steps.image.outputs.tag }} | ||
git config --global user.email 'ci@argoproj.com' | ||
git config --global user.name 'CI' | ||
git diff --exit-code && echo 'Already deployed' || (git commit -am 'Upgrade argocd to ${{ steps.image.outputs.tag }}' && git push) | ||
if: github.event_name == 'push' | ||
working-directory: argoproj-deployments/argocd | ||
# TODO: clean up old images once github supports it: https://github.community/t5/How-to-use-Git-and-GitHub/Deleting-images-from-GitHub-Package-Registry/m-p/41202/thread-id/9811 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
095f5895976155ec570ea550ad81f92b88f1d55f1d7fc8813b30f329a82a83ba awscli-linux-arm64-v2.4.6.zip | ||
095f5895976155ec570ea550ad81f92b88f1d55f1d7fc8813b30f329a82a83ba awscli-linux-arm64-v2.4.6.zip |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer needed sync
image
workflow will cover both PRs and push tomaster