harbor migration #25
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: Release dev | |
on: | |
push: | |
branches: | |
- develop | |
paths-ignore: | |
- '.github/workflow/**' | |
- '!.github/workflow/release-develop.yaml' | |
workflow_dispatch: | |
env: | |
DOCKER_REGISTRY_URL: 'harbor.dev.intra.fph.hu' | |
DOCKER_PHP_BUILD_FILE: 'k8s/php/Dockerfile' | |
DOCKER_NGINX_BUILD_FILE: 'k8s/nginx/Dockerfile' | |
DOCKER_PHP_IMAGE: 'docker/residential-meeting-admin-php' | |
DOCKER_NGINX_IMAGE: 'docker/residential-meeting-admin-nginx' | |
HELM_REPOSITORY_URL: 'harbor.dev.intra.fph.hu' | |
HELM_REPOSITORY_NAME: 'helm' | |
HELM_REPOSITORY_ALIAS: 'fph' | |
HELM_CHART_NAME: 'php-nginx' | |
HELM_RELEASE_NAME: 'backend' | |
HELM_VALUES_FILE: 'values.dev.yaml' | |
APP_NAMESPACE: 'residential-meeting-admin' | |
jobs: | |
create-image-tag: | |
name: Create container image tag | |
runs-on: ["fph-dev-cluster"] | |
outputs: | |
imageTag: ${{ steps.tag-helper.outputs.imageTag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: 'Tag helper' | |
id: tag-helper | |
uses: 'fphgov/actions-image-tag-helper@master' | |
with: | |
is_add_short_commit_hash: true | |
build-php-image: | |
name: Build php contanier image | |
runs-on: ["fph-dev-cluster"] | |
needs: | |
- create-image-tag | |
timeout-minutes: 600 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Build image | |
uses: fphgov/action-kaniko@master | |
with: | |
image: ${{ env.DOCKER_PHP_IMAGE }} | |
build_file: ${{ env.DOCKER_PHP_BUILD_FILE }} | |
path: . | |
registry: ${{ env.DOCKER_REGISTRY_URL }} | |
extra_args: "--skip-tls-verify" | |
username: ${{ secrets.DEV_HARBOR_USER }} | |
password: ${{ secrets.DEV_HARBOR_PASSWD }} | |
tag_with_latest: true | |
tag: ${{ needs.create-image-tag.outputs.imageTag }} | |
build-nginx-image: | |
name: Build nginx container image | |
runs-on: ["fph-dev-cluster"] | |
needs: | |
- create-image-tag | |
timeout-minutes: 600 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Build image | |
uses: fphgov/action-kaniko@master | |
with: | |
image: ${{ env.DOCKER_NGINX_IMAGE }} | |
build_file: ${{ env.DOCKER_NGINX_BUILD_FILE }} | |
path: . | |
target: app | |
registry: ${{ env.DOCKER_REGISTRY_URL }} | |
extra_args: "--skip-tls-verify" | |
username: ${{ secrets.DEV_HARBOR_USER }} | |
password: ${{ secrets.DEV_HARBOR_PASSWD }} | |
tag_with_latest: true | |
tag: ${{ needs.create-image-tag.outputs.imageTag }} | |
deploy: | |
name: Deploy | |
runs-on: ["fph-dev-cluster"] | |
needs: | |
- build-php-image | |
- build-nginx-image | |
- create-image-tag | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Deploy | |
uses: 'fphgov/actions-helm-deploy@harbor' | |
with: | |
helm_repository_url: ${{ env.HELM_REPOSITORY_URL }} | |
helm_repository_name: ${{ env.HELM_REPOSITORY_NAME }} | |
helm_repository_alias: ${{ env.HELM_REPOSITORY_ALIAS }} | |
helm_repository_user: ${{ secrets.DEV_HARBOR_USER }} | |
helm_repository_password: ${{ secrets.DEV_HARBOR_PASSWD }} | |
helm_repository_insecure: 'true' | |
helm_chart: ${{ env.HELM_CHART_NAME }} | |
namespace: ${{ env.APP_NAMESPACE }} | |
app_name: ${{ env.HELM_RELEASE_NAME }} | |
kubeconfig: ${{ secrets.DEV_KUBECONFIG }} | |
helm_values_file: ${{ env.HELM_VALUES_FILE }} | |
helm_repository_upgrade_extra_args: | | |
--set php.image.tag=${{ needs.create-image-tag.outputs.imageTag }} | |
--set nginx.image.tag=${{ needs.create-image-tag.outputs.imageTag }} | |
--set env[0].value=${{ secrets.SMTP_NAME }} | |
--set env[1].value=${{ secrets.SMTP_HOST }} | |
--set env[2].value="${{ secrets.SMTP_PORT }}" | |
--set env[3].value=${{ secrets.SMTP_CONNECTION_CLASS }} | |
--set env[5].value=${{ secrets.SMTP_CONNECTION_CONFIG_PASSWORD }} | |
--set env[6].value=${{ secrets.SMTP_DEFAULTS_ADD_FROM }} | |
--set env[8].value=${{ secrets.SMTP_HEADERS_MESSAGE_ID_DOMAIN }} | |
--set env[10].value=${{ secrets.APP_EMAIL }} | |
--set env[11].value="${{ secrets.APP_PHONE }}" | |
--set env[14].value=${{ secrets.RECAPTCHA_SECRET }} | |
--set env[15].value=${{ secrets.APP_STAT_TOKEN }} | |
--set env[35].value=${{ secrets.JWT_JTI }} | |
--set env[38].value=${{ secrets.JWT_SECRET }} |