This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
Deploy Latest Registry Docker Images (3scale-dev) #8
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
name: Deploy Latest Registry Docker Images (3scale-dev) | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy-latest-registry: | |
name: Deploy Latest Registry Image | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'apicurio' | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Get digest (API) | |
run: | | |
docker pull quay.io/apicurio/apicurio-registry-sql:latest-snapshot | |
docker image inspect quay.io/apicurio/apicurio-registry-sql:latest-snapshot | |
REGISTRY_API_DOCKER_IMAGE=$(docker image inspect --format='{{index .RepoDigests 0}}' quay.io/apicurio/apicurio-registry-sql:latest-snapshot) | |
echo "REGISTRY_API_DOCKER_IMAGE=$REGISTRY_API_DOCKER_IMAGE" >> $GITHUB_ENV | |
- name: Get digest (UI) | |
run: | | |
docker pull quay.io/apicurio/apicurio-registry-ui:latest-snapshot | |
docker image inspect quay.io/apicurio/apicurio-registry-ui:latest-snapshot | |
REGISTRY_UI_DOCKER_IMAGE=$(docker image inspect --format='{{index .RepoDigests 0}}' quay.io/apicurio/apicurio-registry-ui:latest-snapshot) | |
echo "REGISTRY_UI_DOCKER_IMAGE=$REGISTRY_UI_DOCKER_IMAGE" >> $GITHUB_ENV | |
- name: Echo the Docker Images | |
run: | | |
echo "API image: $REGISTRY_API_DOCKER_IMAGE" | |
echo " UI image: $REGISTRY_UI_DOCKER_IMAGE" | |
- name: Code Checkout | |
run: | | |
mkdir repo | |
cd repo | |
git init | |
git config --global user.name "apicurio-ci" | |
git config --global user.email "[email protected]" | |
git remote add origin "https://apicurio-ci:${{ secrets.ACCESS_TOKEN }}@github.com/Apicurio/apicurio-operate-first.git" | |
git fetch | |
git checkout main | |
git branch --set-upstream-to=origin/main | |
git pull | |
- name: Update API Docker Image | |
run: | | |
npm install -g yaml-cli | |
cd repo/manifests/registry/base/ | |
yaml set deployment-api.yaml spec.template.spec.containers.0.image ${{ env.REGISTRY_API_DOCKER_IMAGE }} > deployment-api-NEW.yaml | |
rm deployment-api.yaml | |
mv deployment-api-NEW.yaml deployment-api.yaml | |
# - name: Update API Docker Image | |
# uses: fjogeleit/[email protected] | |
# with: | |
# valueFile: 'repo/manifests/registry/base/deployment-api.yaml' | |
# propertyPath: 'spec.template.spec.containers.0.image' | |
# value: ${{ env.REGISTRY_API_DOCKER_IMAGE }} | |
# commitChange: false | |
# - name: Update UI Docker Image | |
# uses: fjogeleit/[email protected] | |
# with: | |
# valueFile: 'repo/manifests/registry/base/deployment-ui.yaml' | |
# propertyPath: 'spec.template.spec.containers[:1].image' | |
# value: ${{ env.REGISTRY_UI_DOCKER_IMAGE }} | |
# commitChange: false | |
- name: Cat Changed Deployment | |
run: | | |
cd repo | |
echo "---" | |
cat manifests/registry/base/deployment-api.yaml | |
echo "---" | |
git status |