#350 Simplify article filtering (#782) #426
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: Strapi/Next deploy pipeline | |
on: | |
push: | |
tags: | |
- 'dev**' | |
- 'staging**' | |
- 'prod**' | |
# uncomment this to get automatic deploys on master branch ("branches" | |
# should be on same indent as "tags") | |
branches: | |
- master | |
jobs: | |
validate: | |
name: Validate typescript | |
uses: bratislava/github-actions/.github/workflows/validate-typescript.yml@stable | |
with: | |
directory: './next' | |
typescript-directory: './next' | |
conditions: | |
needs: validate | |
name: Check for cluster conditions | |
uses: bratislava/github-actions/.github/workflows/cluster-deploy-conditions.yml@stable | |
deploy-dev: | |
name: after dev Strapi deploy Next | |
if: needs.conditions.outputs.dev == 'true' | |
needs: [conditions, deploy-dev-strapi, build-storybook] | |
uses: bratislava/github-actions/.github/workflows/deploy-with-bratiska-cli.yml@stable | |
with: | |
directory: next/ | |
namespace: olo | |
cluster: tkg-innov-dev | |
url: https://tkg.dev.bratislava.sk | |
debug: --debug | |
secrets: | |
# to obtain a new token, follow this readme https://github.com/bratislava/github-actions/?tab=readme-ov-file#setup-new-namespace | |
service-account: ${{ secrets.DEV_OLO_TOKEN }} | |
registry-pass: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
docker-pass: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
deploy-dev-strapi: | |
name: dev Strapi | |
needs: conditions | |
if: needs.conditions.outputs.dev-strapi == 'true' | |
uses: bratislava/github-actions/.github/workflows/deploy-with-bratiska-cli.yml@stable | |
with: | |
directory: strapi/ | |
namespace: olo | |
cluster: tkg-innov-dev | |
url: https://tkg.dev.bratislava.sk | |
debug: --debug | |
secrets: | |
service-account: ${{ secrets.DEV_OLO_TOKEN }} | |
registry-pass: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
docker-pass: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
deploy-dev-next: | |
name: dev Next | |
needs: [conditions, build-storybook] | |
if: needs.conditions.outputs.dev-next == 'true' | |
uses: bratislava/github-actions/.github/workflows/deploy-with-bratiska-cli.yml@stable | |
with: | |
directory: next/ | |
namespace: olo | |
cluster: tkg-innov-dev | |
url: https://tkg.dev.bratislava.sk | |
debug: --debug | |
secrets: | |
service-account: ${{ secrets.DEV_OLO_TOKEN }} | |
registry-pass: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
docker-pass: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
deploy-staging: | |
name: after staging Strapi deploy Next | |
if: needs.conditions.outputs.staging == 'true' | |
needs: [conditions, deploy-staging-strapi, build-storybook] | |
uses: bratislava/github-actions/.github/workflows/deploy-with-bratiska-cli.yml@stable | |
with: | |
directory: next/ | |
namespace: olo | |
cluster: tkg-innov-staging | |
url: https://tkg.staging.bratislava.sk | |
debug: --debug | |
flag: --staging | |
secrets: | |
service-account: ${{ secrets.STAGING_OLO_TOKEN }} | |
registry-pass: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
docker-pass: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
deploy-staging-strapi: | |
name: staging Strapi | |
needs: conditions | |
if: needs.conditions.outputs.staging-strapi == 'true' | |
uses: bratislava/github-actions/.github/workflows/deploy-with-bratiska-cli.yml@stable | |
with: | |
directory: strapi/ | |
namespace: olo | |
cluster: tkg-innov-staging | |
url: https://tkg.staging.bratislava.sk | |
debug: --debug | |
flag: --staging | |
secrets: | |
service-account: ${{ secrets.STAGING_OLO_TOKEN }} | |
registry-pass: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
docker-pass: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
deploy-staging-next: | |
name: staging Next | |
needs: [conditions, build-storybook] | |
if: needs.conditions.outputs.staging-next == 'true' | |
uses: bratislava/github-actions/.github/workflows/deploy-with-bratiska-cli.yml@stable | |
with: | |
directory: next/ | |
namespace: olo | |
cluster: tkg-innov-staging | |
url: https://tkg.staging.bratislava.sk | |
debug: --debug | |
flag: --staging | |
secrets: | |
service-account: ${{ secrets.STAGING_OLO_TOKEN }} | |
registry-pass: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
docker-pass: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
deploy-prod: | |
name: after prod Strapi deploy Next | |
if: needs.conditions.outputs.prod == 'true' | |
needs: [conditions, deploy-prod-strapi, build-storybook] | |
uses: bratislava/github-actions/.github/workflows/deploy-with-bratiska-cli.yml@stable | |
with: | |
directory: next/ | |
namespace: olo | |
cluster: tkg-innov-prod | |
url: https://tkg.bratislava.sk | |
flag: --production | |
secrets: | |
service-account: ${{ secrets.PROD_OLO_TOKEN }} | |
registry-pass: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
docker-pass: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
deploy-prod-strapi: | |
name: prod Strapi | |
needs: conditions | |
if: needs.conditions.outputs.prod-strapi == 'true' | |
uses: bratislava/github-actions/.github/workflows/deploy-with-bratiska-cli.yml@stable | |
with: | |
directory: strapi/ | |
namespace: olo | |
cluster: tkg-innov-prod | |
url: https://tkg.bratislava.sk | |
flag: --production | |
debug: --debug | |
secrets: | |
service-account: ${{ secrets.PROD_OLO_TOKEN }} | |
registry-pass: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
docker-pass: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
deploy-prod-next: | |
name: prod Next | |
needs: [conditions, build-storybook] | |
if: needs.conditions.outputs.prod-next == 'true' | |
uses: bratislava/github-actions/.github/workflows/deploy-with-bratiska-cli.yml@stable | |
with: | |
directory: next/ | |
namespace: olo | |
cluster: tkg-innov-prod | |
url: https://tkg.bratislava.sk | |
flag: --production | |
debug: --debug | |
secrets: | |
service-account: ${{ secrets.PROD_OLO_TOKEN }} | |
registry-pass: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
docker-pass: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
build-storybook: | |
name: Build & Push Storybook | |
needs: conditions | |
runs-on: ["self-hosted", "Linux", "X64", "bratislava"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Docker Metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ vars.HARBOR_REGISTRY }}/${{ vars.HARBOR_NAMESPACE }}/olo-next-storybook | |
tags: ${{ github.sha }} | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log into registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ vars.HARBOR_REGISTRY }} | |
username: ${{ secrets.HARBOR_REGISTRY_USERNAME }} | |
password: ${{ secrets.HARBOR_REGISTRY_PASSWORD }} | |
- name: Prep Build Envs | |
run: | | |
build_env_path="next/.env.production.local" | |
if [[ "${{ needs.conditions.outputs.prod }}" == "true" ]]; then | |
cp next/.env.bratiska-cli-build.prod "$build_env_path" | |
elif [[ "${{ needs.conditions.outputs.staging }}" == "true" ]]; then | |
cp next/.env.bratiska-cli-build.staging "$build_env_path" | |
else | |
cp next/.env.bratiska-cli-build.dev "$build_env_path" | |
fi | |
- name: Build and Push | |
uses: docker/build-push-action@v5 | |
with: | |
context: "./next" | |
file: "./next/Dockerfile.storybook" | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} |