-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.2 KB
/
build_and_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: "Build and Deploy"
on:
push:
branches: master
jobs:
build-publish:
name: Build & Publish Image
runs-on: ubuntu-latest
env:
IMAGE_NAME: ghcr.io/liquidvotingio/liquid-decidim-demo
TAG: ${{ github.sha }}
steps:
- uses: actions/checkout@v2
- name: Build liquid-decidim-demo Image
run: |
docker build \
-t $IMAGE_NAME:$TAG .
docker tag $IMAGE_NAME:$TAG $IMAGE_NAME:latest
- name: Publish decidim-staging Image to Github Container Registry
uses: azure/docker-login@v1
with:
login-server: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CONTAINER_REGISTRY_PAT }}
- run: |
docker push $IMAGE_NAME
deploy:
name: Deploy to Linode
needs: [build-publish]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Deploy
env:
KUBE_CONFIG_DATA: ${{ secrets.LINODE_KUBE_CONFIG }}
run: |
echo "$KUBE_CONFIG_DATA" | base64 --decode > /tmp/config
export KUBECONFIG=/tmp/config
kubectl rollout restart deployment/decidim-demo-deployment
kubectl rollout restart deployment/decidim-demo-sidekiq-deployment