forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 3
61 lines (56 loc) · 2.46 KB
/
image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Image
on:
push:
branches:
- "release-*" # Codefresh change instead of `master`
env:
GOLANG_VERSION: "1.19"
jobs:
publish:
runs-on: ubuntu-latest
env:
GOPATH: /home/runner/work/argo-cd/argo-cd
steps:
- uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f # v1.1.3
with:
go-version: ${{ env.GOLANG_VERSION }}
- uses: actions/checkout@61b9e3751b92087fd0b06925ba6dd6314e06f089 # master
with:
path: src/github.com/argoproj/argo-cd
# get image tag
- run: echo ::set-output name=tag::$(cat ./VERSION)-${GITHUB_SHA::8}
working-directory: ./src/github.com/argoproj/argo-cd
id: image
# build
- run: |
docker images -a --format "{{.ID}}" | xargs -I {} docker rmi {}
make image DEV_IMAGE=true DOCKER_PUSH=false IMAGE_NAMESPACE=ghcr.io/codefresh-io IMAGE_TAG=${{ steps.image.outputs.tag }}
working-directory: ./src/github.com/argoproj/argo-cd
- run: |
docker login ghcr.io --username $USERNAME --password $PASSWORD
docker push ghcr.io/codefresh-io/argocd:${{ steps.image.outputs.tag }}
env:
USERNAME: ${{ github.repository_owner }}
PASSWORD: ${{ secrets.TOKEN }}
# Codefresh step
- name: Push docker image to quay repository
env:
QUAY_USERNAME: ${{ secrets.RELEASE_QUAY_USERNAME }}
QUAY_TOKEN: ${{ secrets.RELEASE_QUAY_TOKEN }}
IMAGE_NAMESPACE: quay.io/codefresh
run: |
set -ue
docker login quay.io --username "${QUAY_USERNAME}" --password "${QUAY_TOKEN}"
docker tag ghcr.io/codefresh-io/argocd:${{ steps.image.outputs.tag }} ${IMAGE_NAMESPACE}/argocd:latest
docker push ${IMAGE_NAMESPACE}/argocd:latest
# deploy
- run: git clone "https://[email protected]/codefresh-io/argoproj-deployments"
env:
TOKEN: ${{ secrets.TOKEN }}
- run: |
docker run -v $(pwd):/src -w /src --rm -t lyft/kustomizer:v3.3.0 kustomize edit set image quay.io/argoproj/argocd=ghcr.io/codefresh-io/argocd:${{ steps.image.outputs.tag }}
git config --global user.email '[email protected]'
git config --global user.name 'CI-Codefresh'
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