Skip to content

Commit

Permalink
render s3 buckets as gitlab ci cd variables
Browse files Browse the repository at this point in the history
  • Loading branch information
xbbshampoo committed Sep 20, 2023
1 parent 691ff29 commit dcb74e7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish-pro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
args: --no-progress --exclude '.git/*' --exclude 'node_modules/*' --exclude 'build/*' --exclude '.github/*'
env:
AWS_S3_BUCKET: 'unicons.iconscout.com'
AWS_S3_BUCKET: 'unicons-iconscout-a5996f0'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEST_DIR: 'release-pro/${{ steps.extract_version.outputs.VERSION }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish-rc-pro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
with:
args: --no-progress --exclude '.git/*' --exclude 'node_modules/*' --exclude 'build/*' --exclude '.github/*'
env:
AWS_S3_BUCKET: 'unicons.iconscout.com'
AWS_S3_BUCKET: 'unicons-iconscout-a5996f0'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEST_DIR: 'release-pro/${{ steps.extract_version.outputs.VERSION }}'
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
args: --no-progress --exclude '.git/*' --exclude 'node_modules/*' --exclude 'build/*' --exclude '.github/*'
env:
AWS_S3_BUCKET: 'unicons.iconscout.com'
AWS_S3_BUCKET: 'unicons-iconscout-a5996f0'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEST_DIR: 'release/${{ steps.extract_version.outputs.VERSION }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
args: --no-progress --exclude '.git/*' --exclude 'node_modules/*' --exclude 'build/*' --exclude '.github/*'
env:
AWS_S3_BUCKET: 'unicons.iconscout.com'
AWS_S3_BUCKET: 'unicons-iconscout-a5996f0'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEST_DIR: 'release/${{ steps.extract_version.outputs.VERSION }}'
Expand Down
7 changes: 5 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
variables:
S3_UNICONS_BUCKET: unicons-iconscout-a5996f0

stages:
- build
- deploy
Expand All @@ -23,8 +26,8 @@ deploy:
needs:
- build
script:
- aws s3 cp ./ s3://unicons.iconscout.com/release/$CI_COMMIT_REF_NAME/ --recursive --exclude ".git/*" --exclude "node_modules/*" --exclude "build/*" --exclude ".gitlab-ci.yml" --endpoint-url $AWS_ENDPOINT
- aws s3 cp ./json/ s3://unicons.iconscout.com/release/$CI_COMMIT_REF_NAME/json/ --recursive --content-type application/json --endpoint-url $AWS_ENDPOINT
- aws s3 cp ./ s3://$S3_UNICONS_BUCKET/release/$CI_COMMIT_REF_NAME/ --recursive --exclude ".git/*" --exclude "node_modules/*" --exclude "build/*" --exclude ".gitlab-ci.yml" --endpoint-url $AWS_ENDPOINT
- aws s3 cp ./json/ s3://$S3_UNICONS_BUCKET/release/$CI_COMMIT_REF_NAME/json/ --recursive --content-type application/json --endpoint-url $AWS_ENDPOINT
environment:
name: production/$CI_COMMIT_REF_NAME
url: https://unicons.iconscout.com/release/$CI_COMMIT_REF_NAME/index.html

0 comments on commit dcb74e7

Please sign in to comment.