CI #33
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
release: | |
types: [published] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Tag name | |
id: tag | |
run: echo "::set-output name=tag::${{ github.event.release.name }}" | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${{ github.event.release.target_commitish }})" | |
id: extract_branch | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ steps.extract_branch.outputs.branch }} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and Push | |
run: | | |
git pull origin ${{ steps.extract_branch.outputs.branch }} | |
git checkout ${{ steps.extract_branch.outputs.branch }} | |
cat pyicub/__init__.py | |
sed -i "/__version__ =/c\__version__ = '${{ steps.tag.outputs.tag }}'" pyicub/__init__.py | |
cat pyicub/__init__.py | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Commit Files | |
run: | | |
git config --global user.name 'S4HRI bot' | |
git config --global user.email '[email protected]' | |
git diff --exit-code || git commit -m "Auto versioning" -a | |
- name: Push Changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ steps.extract_branch.outputs.branch }} | |
force: true |