Update VERSION to v0.1.3 #19
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: Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker | |
env: | |
DOCKER_CLI_EXPERIMENTAL: enabled | |
uses: crazy-max/ghaction-setup-docker@v2 | |
with: | |
version: v24.0.6 | |
daemon-config: | | |
{ | |
"features": { | |
"containerd-snapshotter": true | |
} | |
} | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Set Up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Get version from VERSION file | |
id: get_version | |
run: echo "::set-output name=version::$(cat VERSION)" | |
- name: Check if Docker image already exists | |
id: check_image | |
run: | | |
VERSION_EXISTS=$(docker pull ${{ secrets.DOCKERHUB_USERNAME }}/mpp-pynq-front:${{ steps.get_version.outputs.version }} && echo "true" || echo "false") | |
echo "::set-output name=exists::$VERSION_EXISTS" | |
- name: Build Docker image | |
run: | | |
if [ "${{ steps.check_image.outputs.exists }}" = "false" ]; then | |
bash build.sh | |
else | |
echo "Docker image with this version already exists. Skipping build and push." | |
fi | |
create-release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Get version from VERSION file | |
id: get_version | |
run: echo "::set-output name=version::$(cat VERSION)" | |
- name: Release Existence Action | |
uses: insightsengineering/release-existence-action@v1.0.0 | |
id: check_release | |
with: | |
release-tag: ${{ steps.get_version.outputs.version }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_version.outputs.version }} | |
release_name: Release ${{ steps.get_version.outputs.version }} | |
draft: false | |
prerelease: false | |
if: steps.check_release.outputs.release-exists |