configure AWS S3 credentials to upload standard components
This commit is contained in:
parent
901eb5235d
commit
bbb1ad07ca
|
@ -24,6 +24,13 @@ jobs:
|
||||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||||
- run: yarn test
|
- run: yarn test
|
||||||
|
|
||||||
|
- name: Configure AWS Credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: eu-west-1
|
||||||
|
|
||||||
- name: Publish budibase packages to NPM
|
- name: Publish budibase packages to NPM
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
|
@ -4,7 +4,6 @@ const fs = require("fs")
|
||||||
|
|
||||||
const TO_SYNC = "dist/"
|
const TO_SYNC = "dist/"
|
||||||
const BUCKET_LOCATION = "s3://prod-budi-app-assets/assets"
|
const BUCKET_LOCATION = "s3://prod-budi-app-assets/assets"
|
||||||
const BASE_PROFILE = "budibase"
|
|
||||||
const S3_COMP_DIR = "@budibase/standard-components/dist"
|
const S3_COMP_DIR = "@budibase/standard-components/dist"
|
||||||
const MANIFEST = "componentlibrary-latest.json"
|
const MANIFEST = "componentlibrary-latest.json"
|
||||||
|
|
||||||
|
@ -13,10 +12,6 @@ function buildS3Path() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
let profile = process.env.AWS_PROFILE
|
|
||||||
if (profile == null) {
|
|
||||||
profile = BASE_PROFILE
|
|
||||||
}
|
|
||||||
// basic manifest file describing the latest
|
// basic manifest file describing the latest
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
MANIFEST,
|
MANIFEST,
|
||||||
|
@ -25,10 +20,8 @@ async function run() {
|
||||||
dir: S3_COMP_DIR,
|
dir: S3_COMP_DIR,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
execSync(`aws s3 sync ${TO_SYNC} ${buildS3Path()} --profile ${profile}`)
|
execSync(`aws s3 sync ${TO_SYNC} ${buildS3Path()}`)
|
||||||
execSync(
|
execSync(`aws s3 cp ${MANIFEST} ${BUCKET_LOCATION}/${MANIFEST}`)
|
||||||
`aws s3 cp ${MANIFEST} ${BUCKET_LOCATION}/${MANIFEST} --profile ${profile}`
|
|
||||||
)
|
|
||||||
fs.unlinkSync(MANIFEST)
|
fs.unlinkSync(MANIFEST)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue