-
Notifications
You must be signed in to change notification settings - Fork 4
65 lines (61 loc) · 2 KB
/
containers.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
60
61
62
63
64
65
name: Containers
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- 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: Build and push app
id: app_build
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/lbcclib/community_archive/app:${{ github.sha }}
file: .docker/Dockerfile.app
-
name: Build and push worker
id: worker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ghcr.io/lbcclib/community_archive/worker:${{ github.sha }}
file: .docker/Dockerfile.worker
deploy-staging:
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
env:
BUNDLE_WITH: deployment_script
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: azure/setup-kubectl@v1
- name: Login via Az module
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Log in to AKS
run: az aks get-credentials --name ${{ secrets.K8S_CLUSTER_NAME }} --resource-group ${{ secrets.K8S_CLUSTER_RG }}
- uses: azure/setup-helm@v1
with:
version: v3.6.3
- name: Set up dotenv file
run: |
echo SMTP_ADDRESS=${{ secrets.SMTP_ADDRESS }} >> .env
echo SMTP_PASS=${{ secrets.SMTP_PASS }} >> .env
echo SMTP_PORT=${{ secrets.SMTP_PORT }} >> .env
echo SMTP_USER=${{ secrets.SMTP_USER }} >> .env
echo GOOGLE_DRIVE_API_CLIENT_ID=${{ secrets.GOOGLE_DRIVE_API_CLIENT_ID }} >> .env
echo GOOGLE_DRIVE_API_CLIENT_SECRET=${{ secrets.GOOGLE_DRIVE_API_CLIENT_SECRET }} >> .env
- name: Run deploy script
run: bundle exec ruby .helm/deploy.rb upgrade ${{ github.sha }}