-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔧 add workflow file for all studios and web #2672 #2673
Open
millianapia
wants to merge
3
commits into
main
Choose a base branch
from
malj/2672
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+226
−0
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
name: PROD - Deploy All Studios and Webs | ||
on: | ||
workflow_dispatch: | ||
permissions: | ||
id-token: write | ||
jobs: | ||
# Update Radix config for both studios and webs | ||
update-radix-config: | ||
runs-on: ubuntu-latest | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
steps: | ||
- name: Checkout internal 🛎️ | ||
id: checkout-internal | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'equinor/energyvision-internal' | ||
ref: main | ||
token: ${{ secrets.PADMS_PAT }} | ||
- name: Promote preprod tag to prod (studios) 🗒️ | ||
if: github.ref == 'refs/heads/main' | ||
shell: bash | ||
id: promote-studios | ||
run: | | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
python -m pip install ruamel.yaml | ||
python ci/promoteAllToProduction.py studio | ||
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 all studios to production" | ||
git pull --rebase origin main | ||
git push origin HEAD:main | ||
fi | ||
- name: Promote preprod tag to prod (webs) 🗒️ | ||
if: github.ref == 'refs/heads/main' | ||
shell: bash | ||
id: promote-webs | ||
run: | | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
python -m pip install ruamel.yaml | ||
python ci/promoteAllToProduction.py web | ||
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 all web sites to production" | ||
git pull --rebase origin main | ||
git push origin HEAD:main | ||
fi | ||
- uses: act10ns/slack@v2 | ||
with: | ||
status: ${{ job.status }} | ||
steps: ${{ toJson(steps) }} | ||
if: failure() | ||
|
||
# Deploy all studios | ||
deploy-studios: | ||
needs: update-radix-config | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: production | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SANITY_STUDIO_API_PROJECT_ID: w3b4om14 | ||
SANITY_STUDIO_MUTATION_TOKEN: ${{ secrets.SANITY_STUDIO_SECRET_MUTATION_TOKEN }} | ||
SANITY_STUDIO_PREVIEW_SECRET: ${{ secrets.SANITY_STUDIO_SECRET_PREVIEW_SECRET }} | ||
SANITY_STUDIO_BRANDMASTER_URL: ${{ secrets.SANITY_STUDIO_BRANDMASTER_URL }} | ||
SANITY_STUDIO_BRANDMASTER_PLUGIN_SOURCE: ${{ secrets.SANITY_STUDIO_BRANDMASTER_PLUGIN_SOURCE }} | ||
SANITY_STUDIO_API_DATASET: secret | ||
SANITY_STUDIO_FOTOWARE_CLIENT_ID: ${{ secrets.SANITY_STUDIO_FOTOWARE_CLIENT_ID }} | ||
SANITY_STUDIO_FOTOWARE_TENANT_URL: ${{ secrets.SANITY_STUDIO_FOTOWARE_TENANT_URL }} | ||
SANITY_STUDIO_FOTOWARE_REDIRECT_ORIGIN: ${{ secrets.SANITY_STUDIO_FOTOWARE_REDIRECT_ORIGIN }} | ||
SANITY_STUDIO_FOTOWARE_AF_EXPORT_URL: ${{ secrets.SANITY_STUDIO_FOTOWARE_AF_EXPORT_URL }} | ||
SANITY_STUDIO_FOTOWARE_AF_EXPORT_KEY: ${{ secrets.SANITY_STUDIO_FOTOWARE_AF_EXPORT_KEY }} | ||
SANITY_STUDIO_SCREEN9_ACCOUNT_ID: ${{ secrets.SANITY_STUDIO_SCREEN9_ACCOUNT_ID }} | ||
SANITY_STUDIO_SCREEN9_TOKEN: ${{ secrets.SANITY_STUDIO_SCREEN9_TOKEN }} | ||
DOCKER_BUILDKIT: 1 | ||
steps: | ||
- name: Checkout internal 🛎️ | ||
id: checkout-internal | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'equinor/energyvision-internal' | ||
ref: main | ||
token: ${{ secrets.PADMS_PAT }} | ||
- name: Install dependencies and deploy studios | ||
run: | | ||
pnpm install | ||
pnpm sanityv3 install | ||
pnpm run deploy --workspace sanityv3 | ||
- uses: act10ns/slack@v2 | ||
with: | ||
status: ${{ job.status }} | ||
steps: ${{ toJson(steps) }} | ||
if: failure() | ||
|
||
# Deploy all webs | ||
deploy-webs: | ||
needs: update-radix-config | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: production | ||
url: https://equinor.com | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
DOCKER_BUILDKIT: 1 | ||
steps: | ||
- name: Checkout internal 🛎️ | ||
uses: actions/checkout@v3 | ||
- name: Deploy to Radix backup 🚀 | ||
id: deploy-backup | ||
uses: equinor/radix-github-actions@master | ||
with: | ||
args: > | ||
create job | ||
deploy | ||
--token-environment | ||
--context production | ||
-a equinor-web-sites | ||
-e ${{ secrets.ENV }} | ||
-f | ||
- name: Deploy to Radix main 🚀 | ||
id: deploy-main | ||
uses: equinor/radix-github-actions@master | ||
with: | ||
args: > | ||
create job | ||
deploy | ||
--token-environment | ||
--context platform2 | ||
-a equinor-web-sites | ||
-e ${{ secrets.ENV }} | ||
-f | ||
- uses: act10ns/slack@v2 | ||
with: | ||
status: ${{ job.status }} | ||
steps: ${{ toJson(steps) }} | ||
if: failure() | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deploy Studios for satellites sites missing. |
||
# Store image tags | ||
store-image-tags: | ||
needs: [deploy-studios, deploy-webs] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout internal 🛎️ | ||
id: checkout-internal | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'equinor/energyvision-internal' | ||
ref: main | ||
token: ${{ secrets.PADMS_PAT }} | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
- name: Install dependencies and store image tags | ||
run: | | ||
npm install js-yaml | ||
node ci/storeImageTags.js studio | ||
node ci/storeImageTags.js web | ||
- name: Commit and push changes | ||
run: | | ||
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 | ||
git add latest-prod-tags.json | ||
git commit -m "Update latest-prod-tags.json with new tags" || echo "No changes to commit" | ||
git push |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy to backup can be removed. There is a clean up task to remove app from backup cluster