Set VERSION to v0.3.0 (#73) #7
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: 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}" |