Skip to content

Commit

Permalink
ci: pin version of upload-release-action
Browse files Browse the repository at this point in the history
  • Loading branch information
derevnjuk committed Mar 4, 2024
1 parent ca64598 commit da66eea
Showing 1 changed file with 3 additions and 69 deletions.
72 changes: 3 additions & 69 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ name: Automated deploy
on:
release:
types: [ created ]
workflow_dispatch:

env:
VERSION: ${{ github.event.release.tag_name }}
TARGET_REF: ${{ github.event.release.target_commitish }}
VERSION: "v11.5.0-next.1"
TARGET_REF: "9197b50080a4796e1b7547f5c381c70005f684d9"

jobs:
install-deps:
Expand Down Expand Up @@ -131,70 +132,3 @@ jobs:
file: .\bin\bright-cli.msi
asset_name: bright-cli.msi
tag: ${{ github.ref }}

publish:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.TARGET_REF }}
token: ${{ secrets.GPR_TOKEN }}

- uses: actions/download-artifact@v3
with:
name: build

- name: Setup node
uses: ./.github/workflows/composite/npm

- name: Set TAG based on target_commitish
run: |
if [ "${{ github.event.release.target_commitish }}" == "next" ]; then
echo "TAG=next" >> $GITHUB_ENV
elif [ "${{ github.event.release.target_commitish }}" == "alpha" ]; then
echo "TAG=alpha" >> $GITHUB_ENV
elif [ "${{ github.event.release.target_commitish }}" == "master" ]; then
echo "TAG=latest" >> $GITHUB_ENV
else
exit 1
fi
- name: Set NPM distribution
run: npm pkg set brightCli.distribution=npm

- run: npm publish --tag $TAG
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# The scope does not align with the package name
# FIXME: once GitHub organization name has been changed, we should prevent this behavior
- name: Prepare GPR package
run: |
npm pkg set name='@neuralegion/bright-cli' \
&& npm pkg set brightCli.distribution=gpr
- name: Setup node
uses: ./.github/workflows/composite/npm
with:
registry: 'https://npm.pkg.github.com'
scope: '@NeuraLegion'

- run: npm publish --tag $TAG
env:
NODE_AUTH_TOKEN: ${{ secrets.GPR_TOKEN }}

- run: sleep 30

- name: Prepare Image Tags
run: |
echo "TAG_REPEATER=brightsec/cli" >> $GITHUB_ENV
- name: Build Images
run: |
docker build . --file Dockerfile --build-arg VERSION=$VERSION -t $TAG_REPEATER:$VERSION -t $TAG_REPEATER:$TAG
- name: Push Images
run: |
docker login --username=${{ secrets.DOCKERHUB_BRIGHT_USER }} --password=${{ secrets.DOCKERHUB_BRIGHT_TOKEN }}
docker push $TAG_REPEATER --all-tags

0 comments on commit da66eea

Please sign in to comment.