diff --git a/.github/workflows/deploy-image.yaml b/.github/workflows/deploy-image.yaml index 6b4c803..1a45293 100644 --- a/.github/workflows/deploy-image.yaml +++ b/.github/workflows/deploy-image.yaml @@ -18,6 +18,10 @@ jobs: - run: | mv env_file/env_file deployment/${{ github.event.inputs.deploy_environment }} + escapedTag=${{ env.APP_IMAGE }} + escapedTag=${escapedTag//[\/]/_} + echo $escapedTag + - name: Inject Variables 1 uses: cschleiden/replace-tokens@v1 with: @@ -25,7 +29,7 @@ jobs: tokenSuffix: '}#' files: '["deployment/${{ github.event.inputs.deploy_environment }}/*.yaml"]' env: - APP_IMAGE: ${{ env.APP_IMAGE }} + APP_IMAGE: ${{ escapedTag }} MAX_REPLICAS: '4' MIN_REPLICAS: '2' UTILISATION_AVERAGE_PERCENT: '75' @@ -59,52 +63,3 @@ jobs: else kubectl --context ${{ secrets.TEST_K8S_CONTEXT }} apply -n ${{ github.event.inputs.deploy_environment }} -k deployment/${{ github.event.inputs.deploy_environment }} fi - - # kubectl --context ${{ secrets.TEST_K8S_CONTEXT }} delete -k deployment/${{ github.event.inputs.deploy_environment }} - #- name: Set the Kubernetes context - # uses: azure/k8s-set-context@v2 - # with: - # method: service-account - # from https://nicwortel.nl/blog/2022/continuous-deployment-to-kubernetes-with-github-actions - # Replace with the URL of the cluster's API server, which can be found using the following command: - # kubectl config view --minify -o 'jsonpath={.clusters[0].cluster.server}' - # k8s-url: '' - # k8s-secret: ${{ secrets.KUBERNETES_SECRET }} - - # service-account approach - #- name: Set the Kubernetes context - # uses: azure/k8s-set-context@v2 - # with: - # method: service-account - #k8s-url: - # k8s-url: ${{ secrets.IBM_CLOUD_K8S_CLUSTER_NAME }} - #k8s-secret: - # k8s-secret: ${{ secrets.IBM_CLOUD_API_KEY }} - # id: setcontext - - # Kubeconfig approach - #- uses: azure/k8s-set-context@v1 - # with: - # method: kubeconfig - # kubeconfig: # Use secret (https://developer.github.com/actions/managing-workflows/storing-secrets/) - # context: #If left unspecified, current-context from kubeconfig is used as default - # id: setcontext - - #- name: Deploy to the Kubernetes cluster - # uses: azure/k8s-deploy@v1 - # with: - # namespace: default - # manifests: | - # deployment/${{ github.event.inputs.deploy_environment }} - # deployment/${{ github.event.inputs.deploy_environment }}/deployment.yaml - # deployment/${{ github.event.inputs.deploy_environment }}/hpa.yaml - # deployment/${{ github.event.inputs.deploy_environment }}/ingress.yaml - # deployment/${{ github.event.inputs.deploy_environment }}/kustomization.yaml - # deployment/${{ github.event.inputs.deploy_environment }}/statistics-dashboard-ui-service.yaml - # #deployment/${{ github.event.inputs.deploy_environment }}/nginx.conf - # images: | - # ${{ env.APP_IMAGE }} - # action: deploy - - #env: - # APP_IMAGE: europeana/statistics-dashboard:${{ github.event.inputs.tag_name || 'develop' }} diff --git a/.github/workflows/node.js.yaml b/.github/workflows/node.js.yaml index 1f34227..471b0a6 100644 --- a/.github/workflows/node.js.yaml +++ b/.github/workflows/node.js.yaml @@ -98,6 +98,12 @@ jobs: - name: Set up Docker Build uses: docker/setup-buildx-action@v3 + - run: | + tag=${{ github.event.inputs.tag_name || 'develop' }} + echo ${tag//[\/]/_} + newTag=${tag//[\/]/_} + echo $newTag + - name: Extract Metadata for Docker Image id: meta uses: docker/metadata-action@v5 @@ -116,6 +122,9 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} ${{ env.PROJECT_VERSION }} ${{ github.event.inputs.tag_name || 'develop' }} + + ${{ newTag }} + - name: Build and push uses: docker/build-push-action@v5 with: