Skip to content

Fix style bugs from Mette on argentina #423

Fix style bugs from Mette on argentina

Fix style bugs from Mette on argentina #423

name: PREPRODV2 - Build & Deploy all webs
on:
workflow_dispatch:
push:
branches:
- upgrade-next-intl
paths:
- 'web/**'
- '!web/README.md'
- '!web/.gitignore'
- '!web/jest.config.cjs'
- '!web/jest.setup.ts'
- './FeatureFlags.js'
- '!web/components/README.md'
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 web ${{ 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 webs to preprod with tag ${{ env.IMAGE_TAG_SHA }}" --allow-empty
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-sites:
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
- name: Deploy website 🌐
id: deploy-website
uses: ./.github/workflows/deploy-web/
with:
projectId: h61q9gi9
imageName: ghcr.io/equinor/energyvision/web-${{ matrix.dataset }}-upgrade
datasetName: ${{ matrix.dataset }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
sanityApiToken: ${{ secrets.SANITY_API_TOKEN }}
algoliaAppId: ${{ vars.ALGOLIA_APP_ID }}
algoliaApiKey: ${{ vars.ALGOLIA_SEARCH_API_KEY }}
environment: ${{ vars.ENV }}
nodeEnvironment: production
archiveContentLink: ${{ vars.ARCHIVE_CONTENT_LINK }}
friendlyCaptchaSitekey: ${{ matrix.dataset == 'brazil' && vars.BRAZIL_FC_SITEKEY || vars.GLOBAL_FC_SITEKEY }}
- uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()