-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.49 KB
/
main.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
name: CI-CD
on:
push:
branches: [ "master" ]
paths-ignore:
- 'README.md'
- 'README.rst'
env:
AWS_DEFAULT_REGION: us-east-1
IMAGE: levdevops/nodejs
IMAGE_TAG: ${{ github.sha }}
jobs:
CI:
runs-on: ubuntu-latest
steps:
- name: Git clone
uses: actions/checkout@v3
- name: Login to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
# Build and Push container to DockerHub
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ env.IMAGE }}:${{ env.IMAGE_TAG }}
# CD:
# runs-on: self-hosted
# needs: CI
# steps:
# - name: Git clone
# uses: actions/checkout@v3
# - name: Make deployment file
# run: |
# envsubst < djangoproject.yaml > eks_djangoproject.yaml
# cat eks_djangoproject.yaml
# - name: AWS Configure
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
# aws-region: ${{ env.AWS_DEFAULT_REGION }}
# - name: Deploy djangoproject to aws eks cluster
# run: |
# aws eks update-kubeconfig --name ${{ secrets.EKS_CLUSTER_NAME }}
# kubectl apply -f eks_djangoproject.yaml