-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
71 additions
and
45 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,71 @@ | ||
name: NPM Publish / CDN Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
npm-publish: | ||
name: NPM Publish and CDN publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Get tag | ||
id: get_tag | ||
run: | | ||
echo ::set-output name=TAG::$(echo $GITHUB_REF | cut -d / -f 3) | ||
echo ::set-output name=MAJOR::$(echo $GITHUB_REF | cut -d / -f 3 | cut -d '.' -f 1) | ||
echo ::set-output name=MINOR::$(echo $GITHUB_REF | cut -d / -f 3 | cut -d '.' -f 2) | ||
echo ::set-output name=PATCH::$(echo $GITHUB_REF | cut -d / -f 3 | cut -d '.' -f 3) | ||
- name: Gcloud auth and write env file | ||
run: | | ||
echo $GOOGLE_APPLICATION_CREDENTIALS > token.json | ||
gcloud auth activate-service-account --key-file=token.json | ||
gcloud container clusters get-credentials $GCLOUD_CLUSTER \ | ||
--zone europe-west1-c --project psessentials-integration | ||
gcloud auth configure-docker | ||
rm token.json | ||
env: | ||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | ||
GCLOUD_CLUSTER: ${{ secrets.GCLOUD_CLUSTER }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@master | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Yarn install | ||
uses: borales/[email protected] | ||
with: | ||
cmd: install | ||
|
||
- name: Yarn build | ||
uses: borales/[email protected] | ||
with: | ||
cmd: build-lib | ||
|
||
- name: Update npm version | ||
run: npm version $VERSION --no-git-tag-version --allow-same-version | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
VERSION: ${{ steps.get_tag.outputs.TAG }} | ||
|
||
- name: Publish | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- run: | | ||
gsutil cp dist/psaccountsVue.umd.min.js gs://prestashop-vuejs-cdn/accounts/$MAJOR.$MINOR.$PATCH/prestashop_accounts_vue_components.min.js | ||
gsutil cp dist/psaccountsVue.umd.min.js gs://prestashop-vuejs-cdn/accounts/x.$MINOR.$PATCH/prestashop_accounts_vue_components.min.js | ||
gsutil cp dist/psaccountsVue.umd.min.js gs://prestashop-vuejs-cdn/accounts/x.x.$PATCH/prestashop_accounts_vue_components.min.js | ||
env: | ||
MAJOR: ${{ steps.get_tag.outputs.MAJOR }} | ||
MINOR: ${{ steps.get_tag.outputs.MINOR }} | ||
PATCH: ${{ steps.get_tag.outputs.PATCH }} |