-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.33 KB
/
cd.yaml
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
name: Continuous Deployment to Openshift
on:
push:
branches:
- master
env:
IMAGE_NAME: website_frontend2
IMAGE_TAGS: latest
jobs:
CD:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: '4.13'
- name: Authenticate and set context
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ secrets.OKD4_HOST }}
openshift_token: ${{ secrets.OKD4_TOKEN }}
namespace: 'verseghy-website-beta'
- name: Buildah Build
id: build
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_TAGS }}
containerfiles: |
./Containerfile
oci: true
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: docker://ghcr.io/verseghy
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Restart deployment
shell: bash
run: |
oc rollout restart deployment website-frontend2