Skip to content

Commit a792ace

Browse files
authored
Create redeploy.yml (#14)
1 parent 1d3a3a4 commit a792ace

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/redeploy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and Redeploy Docker Image
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths-ignore:
7+
- '*.md'
8+
- '.github/workflows/**'
9+
10+
# Allows for manually running this workflow from the Actions tab
11+
workflow_dispatch:
12+
13+
jobs:
14+
build-push-redeploy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
- name: Build and Push Docker Image
20+
run: |
21+
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin docker-registry.ebrains.eu
22+
docker build -t docker-registry.ebrains.eu/ebrains-data-curation/metadata-wizard:${{ github.sha }} .
23+
docker push docker-registry.ebrains.eu/ebrains-data-curation/metadata-wizard:${{ github.sha }}
24+
- name: Write Kubeconfig to File
25+
run: |
26+
mkdir -p ${{ runner.temp }}/.kube
27+
echo "${{ secrets.KUBE_CONFIG }}" > ${{ runner.temp }}/.kube/kubeconfig.yaml
28+
- name: Update Kubernetes Deployment
29+
env:
30+
KUBECONFIG: ${{ runner.temp }}/.kube/kubeconfig.yaml
31+
run: |
32+
kubectl set image deployment/metadata-wizard container-0=docker-registry.ebrains.eu/ebrains-data-curation/metadata-wizard:${{ github.sha }} --namespace=metadata-wizard
33+

0 commit comments

Comments
 (0)