|
| 1 | +name: Build & Production |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - 'release-*' |
| 6 | + branches: |
| 7 | + - master |
| 8 | + |
| 9 | +env: |
| 10 | + CONTAINER_REGISTRY: ghcr.io |
| 11 | + CONTAINER_REGISTRY_USER: ${{ secrets.GHCR_CONTAINER_REGISTRY_USER }} |
| 12 | + CONTAINER_REGISTRY_PASSWORD: ${{ secrets.GHCR_TOKEN }} |
| 13 | + CONTAINER_REGISTRY_REPO: ghcr.io/city-of-helsinki/${{ github.event.repository.name }} |
| 14 | + REPO_NAME: ${{ github.event.repository.name }} |
| 15 | + KUBECONFIG_RAW: ${{ secrets.KUBECONFIG_RAW_STABLE }} |
| 16 | + BUILD_ARTIFACT_FOLDER: 'build_artifacts' |
| 17 | + SERVICE_ARTIFACT_FOLDER: 'service_artifacts' |
| 18 | + SERVICE_PORT: 80 |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags') |
| 23 | + runs-on: ubuntu-latest |
| 24 | + name: Build |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v2 |
| 27 | + - name: Build |
| 28 | + uses: andersinno/kolga-build-action@v2 |
| 29 | + env: |
| 30 | + DOCKER_IMAGE_NAME: ${{ env.REPO_NAME }}-production |
| 31 | + DOCKER_BUILD_ARG_REACT_APP_ENVIRONMENT: 'production' |
| 32 | + DOCKER_BUILD_ARG_REACT_APP_OIDC_AUTHORITY: 'https://api.hel.fi/sso' |
| 33 | + DOCKER_BUILD_ARG_REACT_APP_OIDC_CLIENT_ID: 'https://api.hel.fi/auth/kukkuu-admin-ui' |
| 34 | + DOCKER_BUILD_ARG_REACT_APP_OIDC_SCOPE: 'openid profile https://api.hel.fi/auth/kukkuuapiprod' |
| 35 | + DOCKER_BUILD_ARG_REACT_APP_KUKKUU_API_OIDC_SCOPE: 'https://api.hel.fi/auth/kukkuuapiprod' |
| 36 | + DOCKER_BUILD_ARG_REACT_APP_API_URI: 'https://kukkuu-api.prod.hel.ninja/kukkuu/graphql' |
| 37 | + DOCKER_BUILD_ARG_REACT_APP_SENTRY_DSN: 'https://c89ee3f57dc94ffd940d1df1a353b97f@sentry.hel.ninja/55' |
| 38 | + |
| 39 | + production: |
| 40 | + if: startsWith(github.ref, 'refs/tags') |
| 41 | + runs-on: ubuntu-latest |
| 42 | + needs: build |
| 43 | + name: Production |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v2 |
| 46 | + - uses: andersinno/kolga-setup-action@v2 |
| 47 | + |
| 48 | + - name: Deploy |
| 49 | + uses: andersinno/kolga-deploy-action@v2 |
| 50 | + with: |
| 51 | + track: 'stable' |
| 52 | + env: |
| 53 | + K8S_NAMESPACE: ${{ secrets.K8S_NAMESPACE_STABLE }} |
| 54 | + ENVIRONMENT_URL: https://${{ secrets.ENVIRONMENT_URL_STABLE }} |
| 55 | + DOCKER_IMAGE_NAME: ${{ env.REPO_NAME }}-production |
0 commit comments