-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (42 loc) · 1.46 KB
/
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
name: deploy
on:
push:
branches:
- production
- main
jobs:
publish-docker-image:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Publish the Docker image
run: |
docker build . --tag ghcr.io/kittl/vectorizing:${{ github.ref_name }}
docker push ghcr.io/kittl/vectorizing:${{ github.ref_name }}
- name: Deploy vectorizing in staging cluster
uses: kodermax/kubectl-aws-eks@main
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG }}
if: github.ref_name == 'main'
with:
args: rollout restart deployment/vectorizing --context staging
- name: Deploy vectorizing in production cluster
uses: kodermax/kubectl-aws-eks@main
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG }}
if: github.ref_name == 'production'
with:
args: rollout restart deployment/vectorizing --context production