Skip to content

Commit 82aaaa0

Browse files
committed
feature:DBC22-1560, DBC22-1563, DBC22-1561
1 parent 4a76b63 commit 82aaaa0

File tree

93 files changed

+1575
-2762
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1575
-2762
lines changed

.github/workflows/createTag.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 2a. Create Tag
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
type: string
8+
description: Tag Version (incl. prefix; e.g. v1.2.3)
9+
required: true
10+
message:
11+
type: string
12+
description: Tag Message (e.g. Story Number)
13+
required: true
14+
15+
jobs:
16+
tagging:
17+
if: startsWith(github.ref, 'refs/heads/') == true
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
permissions:
21+
contents: write
22+
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Create a tag
28+
run: |
29+
git config user.name "$GITHUB_ACTOR"
30+
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
31+
git config commit.gpgsign false
32+
33+
git tag -a ${{ github.event.inputs.tag }} -m "${{ github.event.inputs.message }}"
34+
git push origin ${{ github.event.inputs.tag }}

.github/workflows/dev.yml

Lines changed: 123 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,159 @@
1-
name: Deploy main to dev
1+
name: 1. Build & Deploy to Dev
2+
#Will automatically run on a push to main, but can also be run manually
23

34
on:
45
push:
56
branches: [ "main" ]
67
workflow_dispatch:
78

9+
env:
10+
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
11+
REGISTRY_USER: ${{ github.actor }}
12+
REGISTRY_PASSWORD: ${{ github.token }}
13+
14+
815
jobs:
916
build-static:
1017
runs-on: ubuntu-latest
11-
name: Build & Deploy Docker Static images
18+
name: Build & Push Docker Static Image
1219
environment:
1320
name: dev
14-
url: https://dev-drivebc.apps.silver.devops.gov.bc.ca
1521

16-
1722
steps:
18-
- name: checkout code
19-
uses: actions/checkout@v3
23+
- name: Checkout Code
24+
uses: actions/checkout@v4
2025

21-
- name: build static
22-
uses: redhat-actions/buildah-build@v2
26+
- name: Build Static
27+
id: build_image
28+
uses: redhat-actions/buildah-build@v2.9
2329
with:
2430
context: .
2531
layers: true
26-
image: dev-static
27-
tags: latest ${{ github.sha }}
32+
image: drivebc-static
33+
tags: latest latest-dev ${{ github.sha }}
2834
labels: |
29-
app=dev-drivebc
35+
app=drivebc
3036
containerfiles: ./compose/frontend/StaticBuild
3137
build-args: |
32-
API_HOST=${{ vars.API_HOST }}
33-
BASE_MAP=${{ vars.BASE_MAP }}
34-
MAP_STYLE=${{ vars.MAP_STYLE }}
35-
HIGHWAY_LAYER=${{ vars.HIGHWAY_LAYER }}
36-
OPEN511_LAYER=${{ vars.OPEN511_LAYER }}
37-
REPLAY_THE_DAY=${{ vars.REPLAY_THE_DAY }}
38-
ROUTE_PLANNER=${{ vars.ROUTE_PLANNER }}
39-
ROUTE_PLANNER_KEY=${{ vars.ROUTE_PLANNER_KEY }}
40-
GEOCODER_HOST=${{ vars.GEOCODER_HOST }}
41-
GEOCODER_API_AUTH_KEY=${{ vars.GEOCODER_API_AUTH_KEY }}
4238
DEBUG_BUILD=true
43-
- name: push to registry
39+
40+
- name: Push to Github Packages
4441
uses: redhat-actions/push-to-registry@v2.7
4542
with:
46-
image: dev-static
47-
registry: ${{ secrets.REGISTRY }}
48-
username: ${{ secrets.BUILDER_USERNAME }}
49-
password: ${{ secrets.BUILDER_TOKEN }}
43+
image: ${{ steps.build_image.outputs.image }}
44+
tags: ${{ steps.build_image.outputs.tags }}
45+
registry: ${{ env.IMAGE_REGISTRY }}
46+
username: ${{ env.REGISTRY_USER }}
47+
password: ${{ env.REGISTRY_PASSWORD }}
48+
5049

5150
build-backend:
5251
runs-on: ubuntu-latest
53-
name: Build & Deploy Docker Backend images
52+
name: Build & Push Docker Backend Image
5453
environment: dev
5554

5655
steps:
57-
- name: checkout code
58-
uses: actions/checkout@v3
59-
- name: build backend
60-
uses: redhat-actions/buildah-build@v2
56+
- name: Checkout Code
57+
uses: actions/checkout@v4
58+
59+
- name: Build Backend
60+
id: build_image
61+
uses: redhat-actions/buildah-build@v2.9
6162
with:
62-
image: dev-django
63-
tags: latest ${{ github.sha }}
63+
image: drivebc-django
64+
tags: latest latest-dev ${{ github.sha }}
6465
labels: |
65-
app=dev-drivebc
66+
app=drivebc
6667
containerfiles: ./compose/backend/Dockerfile
6768
build-args:
6869
DEBUG_BUILD=true
69-
- name: push to registry
70+
71+
- name: Push to Github Packages
72+
uses: redhat-actions/push-to-registry@v2.7
73+
with:
74+
image: ${{ steps.build_image.outputs.image }}
75+
tags: ${{ steps.build_image.outputs.tags }}
76+
registry: ${{ env.IMAGE_REGISTRY }}
77+
username: ${{ env.REGISTRY_USER }}
78+
password: ${{ env.REGISTRY_PASSWORD }}
79+
80+
81+
build-image-caching:
82+
runs-on: ubuntu-latest
83+
name: Build & Push Docker Image-Caching Image
84+
environment: dev
85+
86+
steps:
87+
- name: Checkout Code
88+
uses: actions/checkout@v4
89+
90+
- name: Build Image Caching
91+
id: build_image
92+
uses: redhat-actions/buildah-build@v2.9
93+
with:
94+
image: drivebc-image-caching
95+
tags: latest latest-dev ${{ github.sha }}
96+
labels: |
97+
app=drivebc
98+
containerfiles: ./compose/caching/Dockerfile
99+
100+
- name: Push to Github Packages
70101
uses: redhat-actions/push-to-registry@v2.7
71102
with:
72-
image: dev-django
73-
registry: ${{ secrets.REGISTRY }}
74-
username: ${{ secrets.BUILDER_USERNAME }}
75-
password: ${{ secrets.BUILDER_TOKEN }}
103+
image: ${{ steps.build_image.outputs.image }}
104+
tags: ${{ steps.build_image.outputs.tags }}
105+
registry: ${{ env.IMAGE_REGISTRY }}
106+
username: ${{ env.REGISTRY_USER }}
107+
password: ${{ env.REGISTRY_PASSWORD }}
108+
109+
build-redis:
110+
runs-on: ubuntu-latest
111+
name: Build & Push Docker Redis Image
112+
environment: dev
113+
114+
steps:
115+
- name: Checkout Code
116+
uses: actions/checkout@v4
117+
118+
- name: Build Redis
119+
id: build_image
120+
uses: redhat-actions/buildah-build@v2.9
121+
with:
122+
image: drivebc-redis
123+
tags: latest latest-dev ${{ github.sha }}
124+
labels: |
125+
app=drivebc
126+
containerfiles: ./compose/redis/Dockerfile
127+
128+
- name: Push to Github Packages
129+
uses: redhat-actions/push-to-registry@v2.7
130+
with:
131+
image: ${{ steps.build_image.outputs.image }}
132+
tags: ${{ steps.build_image.outputs.tags }}
133+
registry: ${{ env.IMAGE_REGISTRY }}
134+
username: ${{ env.REGISTRY_USER }}
135+
password: ${{ env.REGISTRY_PASSWORD }}
136+
137+
versionUpdate:
138+
needs: [build-static, build-backend, build-redis, build-image-caching]
139+
runs-on: ubuntu-latest
140+
name: Deploy Latest Images
141+
environment:
142+
name: dev
143+
url: https://dev-drivebc.apps.gold.devops.gov.bc.ca
144+
steps:
145+
- name: Checkout code
146+
uses: actions/checkout@v4
147+
148+
- name: Authenticate and set context
149+
uses: redhat-actions/oc-login@v1
150+
with:
151+
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
152+
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
153+
namespace: ${{ env.OPENSHIFT_NAMESPACE }}
154+
insecure_skip_tls_verify: true
155+
156+
- name: Helm upgrade on OpenShift Environment
157+
run: |
158+
helm dependency update ./infrastructure/main
159+
helm upgrade dev-drivebc -f ./infrastructure/main/values-dev.yaml ./infrastructure/main --set django.image.tag="${{ github.sha }}" --set image-caching.image.tag="${{ github.sha }}" --set redis.image.tag="${{ github.sha }}" --set static.image.tag="${{ github.sha }}" --set tasks.image.tag="${{ github.sha }}"

.github/workflows/image-caching.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)