Merge pull request #684 from bcgov/feature/devcontainer #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Deploy Development | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- "plugins/**" | |
- "services/tenant-ui/**" | |
- "charts/traction/**" | |
- "charts/tenant-ui/**" | |
jobs: | |
build_ui: | |
name: "Build Tenant UI" | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'bcgov' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build service | |
uses: ./.github/actions/build_ui | |
id: builder | |
with: | |
context: "./services/tenant-ui" | |
image_name: ${{ github.repository_owner}}/traction-tenant-ui | |
registry: ghcr.io | |
registry_username: ${{ github.repository_owner}} | |
registry_password: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
image_tag: ${{ steps.builder.outputs.image_tag }} | |
image_version: ${{ steps.builder.outputs.image_version }} | |
build_acapy: | |
name: "Build Traction Aca-Py" | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'bcgov' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build Aca-Py Image | |
uses: ./.github/actions/build_acapy | |
id: builder | |
with: | |
context: "./plugins" | |
dockerfile: "./plugins/docker/Dockerfile" | |
image_name: ${{ github.repository_owner}}/traction-plugins-acapy | |
registry: ghcr.io | |
registry_username: ${{ github.repository_owner}} | |
registry_password: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
image_tag: ${{ steps.builder.outputs.image_tag }} | |
image_version: ${{ steps.builder.outputs.image_version }} | |
build_proxy: | |
name: "Build Traction Tenant Proxy" | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'bcgov' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build Aca-Py Image | |
uses: ./.github/actions/build_acapy | |
id: builder | |
with: | |
context: "./plugins" | |
dockerfile: "./plugins/docker/Dockerfile.tenant-proxy" | |
image_name: ${{ github.repository_owner}}/traction-tenant-proxy | |
registry: ghcr.io | |
registry_username: ${{ github.repository_owner}} | |
registry_password: ${{ secrets.GITHUB_TOKEN }} | |
outputs: | |
image_tag: ${{ steps.builder.outputs.image_tag }} | |
image_version: ${{ steps.builder.outputs.image_version }} | |
deploy: | |
name: Deploy Dev | |
environment: development | |
runs-on: ubuntu-latest | |
needs: | |
- build_ui | |
- build_acapy | |
- build_proxy | |
if: ${{ always() && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) && (github.repository_owner == 'bcgov') }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Authenticate and set context | |
uses: redhat-actions/oc-login@v1 | |
with: | |
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | |
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | |
certificate_authority_data: ${{ secrets.OPENSHIFT_CA_CRT }} | |
namespace: ${{ secrets.OPENSHIFT_NAMESPACE }} | |
- name: Traction Dev Helm | |
run: | | |
helm upgrade --install traction -f ./deploy/traction/values-development.yaml --set acapy.image.tag=${{ needs.build_acapy.outputs.image_version }} --set traction_proxy.image.tag=${{ needs.build_acapy.outputs.image_version }} ./charts/traction --wait | |
- name: Tenant UI Dev Helm | |
run: | | |
helm upgrade --install tenant-ui -f ./deploy/tenant-ui/values-development.yaml --set image.tag=${{ needs.build_ui.outputs.image_version }} ./charts/tenant-ui --wait | |
- name: Restart Deployments | |
run: | | |
oc rollout restart deployment/traction-acapy | |
oc rollout restart deployment/traction-tenant-proxy | |
oc rollout restart deployment/tenant-ui |