Skip to content

trigger 0.1.0 version #59

trigger 0.1.0 version

trigger 0.1.0 version #59

Workflow file for this run

name: Docker Build
on:
push:
branches: [ verifier ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest # , l5, self-hosted
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Bump version and push tag, Minor version for each merge
uses: anothrNick/[email protected]
id: taggerRun
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
- name: echo tag
run: |
echo "The current tag is: ${{ steps.taggerRun.outputs.new_tag }}"
- name: echo part
run: |
echo "The version increment was: ${{ steps.taggerRun.outputs.part }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image (manual)
run: |
docker build --no-cache -t e36io/hyperfridge-r0:${{ github.run_id }} .
- name: Create and Run Temporary Container
run: |
docker create --name temp-container e36io/hyperfridge-r0:${{ github.run_id }}
docker cp temp-container:/app/IMAGE_ID.hex ./IMAGE_ID.hex
docker cp temp-container:/app ./app
docker cp temp-container:/data ./data
docker rm temp-container
- name: Read the Image Tag
id: read_tag
run: echo "IMAGE_TAG=$(cat IMAGE_ID.hex)" >> $GITHUB_ENV
- name: Zip App and Data Directories to create a release
run: |
zip -r hyperfridge-${{ env.IMAGE_TAG }}-${{ steps.taggerRun.outputs.new_tag }}.zip ./app ./data
- name: Build and Push Docker image with custom tag
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: e36io/hyperfridge-r0:${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }}
# - name: Create GitHub Tag
# if: github.event_name != 'pull_request'
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git tag ${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }}
# git push origin ${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }}
- name: Create GitHub Release with zipped binaries
if: github.event_name != 'pull_request'
run: |
gh release create ${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }} hyperfridge-${{ env.IMAGE_TAG }}-${{ steps.taggerRun.outputs.new_tag }}.zip --title "Release Version ${{ steps.taggerRun.outputs.new_tag }} Image ID:${{ env.IMAGE_TAG }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}