Clean up web docker, fix studio docker with turbo #48
This file contains hidden or 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: UPGRADE PREPROD - Build & deploy all studios | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - upgrade-next-intl | |
| paths: | |
| - 'studio/**/*' | |
| - './FeatureFlags.js' | |
| - '!./README.md' | |
| - '!./.env.development.template' | |
| - '!./studio/scripts/**/*' | |
| permissions: | |
| id-token: write | |
| packages: write | |
| jobs: | |
| update-radix-config: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: preprodv2 | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| steps: | |
| - name: Checkout ๐๏ธ | |
| uses: actions/checkout@v4 | |
| - name: Set image tag ๐ท | |
| shell: bash | |
| id: set-default-image-tag | |
| run: | | |
| echo "IMAGE_TAG_SHA=$(git rev-parse --short=12 ${GITHUB_SHA})" >> $GITHUB_ENV | |
| - name: Checkout internal ๐๏ธ | |
| id: checkout-internal | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'equinor/energyvision-internal' | |
| ref: main | |
| token: ${{ secrets.PADMS_PAT }} # Replace with ssh as per https://stackoverflow.com/questions/60222741/github-actions-and-git-clone-issue | |
| - name: Modify radixconfig tag for preprod on main branch ๐๏ธ | |
| if: github.ref == 'refs/heads/upgrade-next-intl' | |
| shell: bash | |
| id: modify-radix | |
| run: | | |
| # Install pre-requisite | |
| python3 -m venv venv | |
| source venv/bin/activate | |
| python -m pip install ruamel.yaml | |
| python ci/upgradeEnvironment.py studio ${{ env.IMAGE_TAG_SHA }} ${{ vars.ENV }} | |
| git config --global user.name 'github' | |
| git config --global user.email 'padms@users.noreply.github.com' | |
| git remote set-url origin https://x-access-token:${{ secrets.PADMS_PAT }}@github.com/equinor/energyvision-internal | |
| if [[ `git status --porcelain` ]] | |
| then | |
| git commit -am "๐ Deploy studios to preprod for tag ${{ env.IMAGE_TAG_SHA }}" | |
| git pull --rebase origin main | |
| git push origin HEAD:main | |
| fi | |
| - uses: act10ns/slack@v2 | |
| with: | |
| status: ${{ job.status }} | |
| steps: ${{ toJson(steps) }} | |
| if: failure() | |
| read-satellites: | |
| runs-on: ubuntu-latest | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: set-matrix | |
| name: Read from satellites.json | |
| run: | | |
| MATRIX=$(cat satellites.json) | |
| echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT | |
| - uses: act10ns/slack@v2 | |
| with: | |
| status: ${{ job.status }} | |
| steps: ${{ toJson(steps) }} | |
| if: failure() | |
| deploy-all-studios: | |
| needs: [update-radix-config, read-satellites] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: preprodv2 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| dataset: ${{ fromJson(needs.read-satellites.outputs.matrix) }} | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| DOCKER_BUILDKIT: 1 | |
| steps: | |
| - name: Checkout ๐๏ธ | |
| uses: actions/checkout@v4 | |
| - id: deploy-satellite | |
| uses: ./.github/workflows/deploy-studio/ | |
| with: | |
| imageName: ghcr.io/equinor/energyvision/studio-${{ matrix.dataset }}-upgrade | |
| datasetName: ${{ matrix.dataset }} | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| sanityApiToken: ${{ secrets.SANITY_API_TOKEN }} | |
| sanityPreviewToken: ${{ secrets.SANITY_STUDIO_PREVIEW_SECRET }} | |
| brandmasterUrl: ${{ secrets.SANITY_STUDIO_BRANDMASTER_URL }} | |
| brandmasterPluginSource: ${{ secrets.SANITY_STUDIO_BRANDMASTER_PLUGIN_SOURCE }} | |
| fotowareClientId: ${{ secrets.SANITY_STUDIO_FOTOWARE_CLIENT_ID }} | |
| fotowareTenantUrl: ${{ secrets.SANITY_STUDIO_FOTOWARE_TENANT_URL }} | |
| fotowareRedirectOrigin: ${{ secrets.SANITY_STUDIO_FOTOWARE_REDIRECT_ORIGIN }} | |
| fotowareAfExportUrl: ${{ secrets.SANITY_STUDIO_FOTOWARE_AF_EXPORT_URL }} | |
| fotowareAfExportKey: ${{ secrets.SANITY_STUDIO_FOTOWARE_AF_EXPORT_KEY }} | |
| fotowareRedirectUri: ${{ secrets.SANITY_STUDIO_FOTOWARE_REDIRECT_URI}} | |
| fotowareAfApiAccessKey: ${{ secrets.SANITY_STUDIO_FOTOWARE_AF_API_ACCESS_KEY }} | |
| fotowareAfApiAccessUrl: ${{ secrets.SANITY_STUDIO_FOTOWARE_AF_API_ACCESS_URL }} | |
| screen9accountId: ${{ secrets.SANITY_STUDIO_SCREEN9_ACCOUNT_ID }} | |
| screen9token: ${{ secrets.SANITY_STUDIO_SCREEN9_TOKEN }} | |
| environment: ${{ vars.ENV }} | |
| - uses: act10ns/slack@v2 | |
| with: | |
| status: ${{ job.status }} | |
| steps: ${{ toJson(steps) }} | |
| if: failure() |