bump CI action upload-artifact to v4 #440
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 publish Docker image | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get current app version | |
run: | | |
echo "VERSION=$(grep "__version__ =" Squest/version.py |awk '{printf $3}' | sed -e 's/^"//' -e 's/"$//')" >> $GITHUB_ENV | |
- name: Print app version | |
run: | | |
echo ${{ env.VERSION }} | |
- name: Extract Branch Name | |
run: echo "BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV | |
- name: Print branch name | |
run: | | |
echo ${{ env.BRANCH }} | |
- name: Set the image tag name following the branch name | |
run: | | |
if [[ ${{ env.BRANCH }} == "master" ]]; then | |
echo "TAG_NAME=latest" >> $GITHUB_ENV | |
else | |
echo "TAG_NAME=dev" >> $GITHUB_ENV | |
fi | |
- name: Print tag name | |
run: | | |
echo ${{ env.TAG_NAME }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Quay.io | |
uses: docker/login-action@v1 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
- name: Build and push Squest image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: docker/squest.Dockerfile | |
push: true | |
tags: | | |
quay.io/hewlettpackardenterprise/squest:${{ env.VERSION }} | |
quay.io/hewlettpackardenterprise/squest:${{ env.TAG_NAME }} |