Skip to content

4.1.1

4.1.1 #42

Workflow file for this run

name: Release
on:
push:
tags:
- v**
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: git remote add test [email protected]:steadybit/cli.git
- run: npm ci
- run: npm run ci
- name: 'snyk monitor'
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --prune-repeated-subdependencies
command: monitor
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
docker-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Obtain version from GitHub Ref
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Extract Major Version
run: echo "MAJOR_RELEASE_VERSION=$(echo ${{ env.RELEASE_VERSION }} | cut -d . -f 1)" >> $GITHUB_ENV
- name: Build container image
uses: docker/build-push-action@v3
with:
context: ./
load: true
tags: steadybit/cli:latest,steadybit/cli:${{ env.MAJOR_RELEASE_VERSION }},steadybit/cli:${{ env.RELEASE_VERSION }}
- name: Test container
run: docker run --rm steadybit/cli:${{ env.RELEASE_VERSION }} -V
- name: Push container image to Dockerhub
uses: docker/build-push-action@v3
with:
context: ./
push: true
platforms: linux/amd64,linux/arm64
tags: steadybit/cli:latest,steadybit/cli:${{ env.MAJOR_RELEASE_VERSION }},steadybit/cli:${{ env.RELEASE_VERSION }}
- name: "snyk monitor docker image"
uses: snyk/actions/docker@master
with:
image: "steadybit/cli:latest"
args: --file=Dockerfile --target-reference=${{ github.ref_name }} --username=${{ secrets.DOCKER_USERNAME }} --password=${{ secrets.DOCKER_PASSWORD }}
command: monitor
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}