Skip to content

Commit

Permalink
Fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjmaclean committed Apr 3, 2024
1 parent d5bb561 commit 60ebe8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 50 deletions.
55 changes: 5 additions & 50 deletions .github/workflows/deploy-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ 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:
tokenPrefix: '#{'
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'
Expand Down Expand Up @@ -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 <server-url> 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: '<server-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: <URL of the cluster's API server>
# k8s-url: ${{ secrets.IBM_CLOUD_K8S_CLUSTER_NAME }}
#k8s-secret: <secret associated with the service account>
# k8s-secret: ${{ secrets.IBM_CLOUD_API_KEY }}
# id: setcontext

# Kubeconfig approach
#- uses: azure/k8s-set-context@v1
# with:
# method: kubeconfig
# kubeconfig: <your kubeconfig> # Use secret (https://developer.github.com/actions/managing-workflows/storing-secrets/)
# context: <context name> #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' }}
9 changes: 9 additions & 0 deletions .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 60ebe8c

Please sign in to comment.