0.8.2 #13
Workflow file for this run
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
name: Docker Build and Push | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build CLI | |
run: npm run build | |
- name: Log in to Docker Hub | |
run: docker login -u ${{ secrets.MONOKLE_CLI_DOCKERHUB_USERNAME }} -p ${{ secrets.MONOKLE_CLI_DOCKERHUB_TOKEN }} | |
- name: Extract version from tag | |
id: extract_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
- name: Debug version | |
run: echo ${{ env.VERSION }} | |
- name: Build and deploy Docker image | |
env: | |
VERSION: ${{ env.VERSION }} | |
run: | | |
echo "Building Docker image with version: ${VERSION}" | |
docker build -t kubeshop/monokle-cli:latest -t kubeshop/monokle-cli:${VERSION} . | |
docker push kubeshop/monokle-cli:${VERSION} | |
docker push kubeshop/monokle-cli:latest |