Skip to content

Set VERSION to v0.3.0 (#73) #7

Set VERSION to v0.3.0 (#73)

Set VERSION to v0.3.0 (#73) #7

Workflow file for this run

name: Build and push container images for release
on:
push:
tags:
- v*
jobs:
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Extract version from Github ref
id: get-version
env:
TAG: ${{ github.ref }}
run: |
version=${TAG:10}
echo "version=$version" >> $GITHUB_OUTPUT
build:
name: Build release Docker images
runs-on: ubuntu-latest
needs: get-version
steps:
- name: Check-out code
uses: actions/checkout@v3
- name: Build container images
env:
# VERSION must be set for docker image to be tagged correctly
VERSION: ${{ needs.get-version.outputs.version }}
run: make
- name: Push container images
# in case workflow runs from a fork
if: ${{ github.repository == 'antrea-io/antrea-ui' }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
VERSION: ${{ needs.get-version.outputs.version }}
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push antrea/antrea-ui-frontend:"${VERSION}"
docker push antrea/antrea-ui-backend:"${VERSION}"