Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/destroy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ jobs:
fi

- name: Remove Preview Environment from S3
env:
PROCESSED_BRANCH_NAME: ${{ steps.process-branch-name.outputs.processedBranchName }}
run: |
if [ ${{ inputs.target == 'dev' }} ]; then
aws s3 rm s3://${{ secrets.AWS_PREVIEW_BUCKET_NAME }}${{ steps.process-branch-name.outputs.processedBranchName }} --recursive
aws s3 rm s3://${{ secrets.AWS_PREVIEW_BUCKET_NAME }}${PROCESSED_BRANCH_NAME} --recursive
else
aws s3 rm s3://${{ secrets.AWS_PREVIEW_BUCKET_NAME }}/ --recursive
fi
Expand All @@ -66,6 +68,7 @@ jobs:

- name: Remove Deployment PR Comment
if: github.event_name == 'pull_request'
run: gh api --method DELETE /repos/${{ github.repository }}/issues/comments/${{ steps.find-comment.outputs.comment-id }}
run: gh api --method DELETE /repos/${{ github.repository }}/issues/comments/$COMMENT_ID
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENT_ID: ${{ steps.find-comment.outputs.comment-id }}
15 changes: 13 additions & 2 deletions .github/workflows/mainnet-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
type: choice
options: [preview, release]
default: preview
version:
description: 'Version to deploy'
required: true
type: string
default: 'latest'

permissions: {}

Expand All @@ -19,14 +24,20 @@ jobs:
permissions:
contents: write
id-token: write
if: startsWith(github.ref, 'refs/tags/')
if: ${{ inputs.version == 'latest' || startsWith(inputs.version, 'v.') }}

steps:
- name: Find latest tag
if: inputs.version == 'latest'
id: find-latest-tag
run: |
echo "LATEST_TAG=$(git tag -l | sort -V | tail -n1)" >> $GITHUB_OUTPUT

- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.ref_name }}
ref: ${{ inputs.version == 'latest' && steps.find-latest-tag.outputs.LATEST_TAG || inputs.version }}
persist-credentials: false

- name: Setup Node.js
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/testnet-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ jobs:
- name: Deploy to S3 and copy Terms and Privacy Policy files to Website # if main branch, deploy to the root path
env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }}
PROCESSED_BRANCH_NAME: ${{ steps.process-branch-name.outputs.processedBranchName }}
run: |
if [ "$BRANCH_NAME" != "main" ]; then
aws s3 sync ./apps/frontend/dist s3://${{ secrets.AWS_PREVIEW_BUCKET_NAME }}${{ steps.process-branch-name.outputs.processedBranchName }} --delete
aws s3 cp s3://${{ secrets.AWS_POLICY_DOCS_BUCKET }} s3://${{ secrets.AWS_PREVIEW_BUCKET_NAME }}${{ steps.process-branch-name.outputs.processedBranchName }} --recursive
aws s3 sync ./apps/frontend/dist s3://${{ secrets.AWS_PREVIEW_BUCKET_NAME }}${PROCESSED_BRANCH_NAME} --delete
aws s3 cp s3://${{ secrets.AWS_POLICY_DOCS_BUCKET }} s3://${{ secrets.AWS_PREVIEW_BUCKET_NAME }}${PROCESSED_BRANCH_NAME} --recursive
else
aws s3 sync ./apps/frontend/dist s3://${{ secrets.AWS_BUCKET_NAME }}/
aws s3 cp s3://${{ secrets.AWS_POLICY_DOCS_BUCKET }} s3://${{ secrets.AWS_BUCKET_NAME }}/ --recursive
Expand All @@ -83,10 +84,11 @@ jobs:
- name: Cloudfront Invalidation # if main branch, invalidate the root path
env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }}
PROCESSED_BRANCH_NAME: ${{ steps.process-branch-name.outputs.processedBranchName }}
run: |
if [ "$BRANCH_NAME" != "main" ]; then
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_PREVIEW_CLOUDFRONT_DISTRIBUTION_ID }} --paths ${{ steps.process-branch-name.outputs.processedBranchName }} '/*'
echo "🌐 Deployed: https://preview.vevote-dev.vechain.org${{ steps.process-branch-name.outputs.processedBranchName }}" | tee -a "$GITHUB_STEP_SUMMARY"
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_PREVIEW_CLOUDFRONT_DISTRIBUTION_ID }} --paths ${PROCESSED_BRANCH_NAME} '/*'
echo "🌐 Deployed: https://preview.vevote-dev.vechain.org${PROCESSED_BRANCH_NAME}" | tee -a "$GITHUB_STEP_SUMMARY"
else
AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths '/' '/*'
echo "🌐 Deployed: https://vevote-dev.vechain.org/" | tee -a "$GITHUB_STEP_SUMMARY"
Expand Down