generated from ydataai/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(pipelines): change actions to promote versions (#13)
- Loading branch information
1 parent
2566900
commit 42e60e4
Showing
4 changed files
with
12 additions
and
97 deletions.
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
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,16 +4,6 @@ on: | |
release: | ||
types: [ released ] | ||
|
||
env: | ||
COMPONENT: laboratory-controller | ||
|
||
API_CONTAINER: api_container_image | ||
MANAGER_CONTAINER: manager_container_image | ||
|
||
DOCKER_CONTAINER_REGISTRY: ${{ secrets.PRIVATE_CONTAINER_REGISTRY }} | ||
API_DOCKER_IMAGE_URL: ${{ secrets.PRIVATE_CONTAINER_REGISTRY }}/${{ github.repository_owner }}/laboratory-controller/api | ||
MANAGER_DOCKER_IMAGE_URL: ${{ secrets.PRIVATE_CONTAINER_REGISTRY }}/${{ github.repository_owner }}/laboratory-controller/manager | ||
|
||
jobs: | ||
prepare: | ||
name: Extract Version and Build number | ||
|
@@ -33,87 +23,3 @@ jobs: | |
- name: Git Short sha | ||
id: short_sha | ||
run: echo "::set-output name=value::$(git rev-parse --short HEAD)" | ||
|
||
|
||
docker-tag-api: | ||
name: Docker Tag and Push API | ||
runs-on: ubuntu-20.04 | ||
|
||
needs: prepare | ||
|
||
steps: | ||
- uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.DOCKER_CONTAINER_REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
|
||
- name: Docker tag and push | ||
env: | ||
SOURCE: ${API_DOCKER_IMAGE_URL}:${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.build_number }} | ||
DESTINATION: ${API_DOCKER_IMAGE_URL}:${{ needs.prepare.outputs.version }} | ||
run: | | ||
docker pull $SOURCE | ||
docker tag $SOURCE $DESTINATION | ||
docker push $DESTINATION | ||
docker-tag-manager: | ||
name: Docker Tag and Push Manager | ||
runs-on: ubuntu-20.04 | ||
|
||
needs: prepare | ||
|
||
steps: | ||
- uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.DOCKER_CONTAINER_REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
|
||
- name: Docker tag and push | ||
env: | ||
SOURCE: ${MANAGER_DOCKER_IMAGE_URL}:${{ needs.prepare.outputs.version }}.${{ needs.prepare.outputs.build_number }} | ||
DESTINATION: ${MANAGER_DOCKER_IMAGE_URL}:${{ needs.prepare.outputs.version }} | ||
run: | | ||
docker pull $SOURCE | ||
docker tag $SOURCE $DESTINATION | ||
docker push $DESTINATION | ||
update-manifests: | ||
name: Update Manifests | ||
runs-on: ubuntu-20.04 | ||
|
||
needs: | ||
- prepare | ||
- docker-tag-api | ||
- docker-tag-manager | ||
|
||
steps: | ||
- name: Checkout Manifests repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ydataai/manifests | ||
token: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
- uses: imranismail/setup-kustomize@v1 | ||
with: | ||
kustomize-version: "3.8.5" | ||
|
||
- name: Update kustomization image tag | ||
env: | ||
VERSION: ${{ needs.prepare.outputs.version }} | ||
run: | | ||
cd ydata/${COMPONENT} | ||
kustomize edit set image ${API_CONTAINER}=${API_DOCKER_IMAGE_URL}:${VERSION} | ||
kustomize edit set image ${MANAGER_CONTAINER}=${MANAGER_DOCKER_IMAGE_URL}:${VERSION} | ||
- name: Commit and push image update into manifests repo | ||
env: | ||
VERSION: ${{ needs.prepare.outputs.version }} | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Azory YData Bot" | ||
git commit -a -m "chore(bump): [CI] [PROD] bump ${{ env.COMPONENT }} to $VERSION" | ||
git push origin master |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"tagFormat": "${version}", | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github" | ||
] | ||
} |