Added Seqno parameter to several methods (#162) #181
This file contains hidden or 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 Docker Image | |
on: | |
push: | |
jobs: | |
set_version: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Get branch name | |
id: branch_name | |
run: | | |
GIT_BRANCH=`git symbolic-ref --short HEAD | sed "s/[^[:alnum:].]//g"` | |
echo "GIT_BRANCH=${GIT_BRANCH}" >> $GITHUB_OUTPUT | |
- name: Get semantic version | |
uses: paulhatch/[email protected] | |
id: versioning | |
with: | |
tag_prefix: "v" | |
major_pattern: "[MAJOR]" | |
minor_pattern: "[MINOR]" | |
format: "${major}.${minor}.${patch}.dev${increment}" | |
bump_each_commit: false | |
outputs: | |
version: ${{ github.ref == 'refs/heads/master' && steps.versioning.outputs.version_tag || steps.versioning.outputs.version}} | |
buildx: | |
runs-on: ubuntu-22.04 | |
needs: [ set_version ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Inspect builder | |
run: | | |
echo "Name: ${{ steps.buildx.outputs.name }}" | |
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" | |
echo "Status: ${{ steps.buildx.outputs.status }}" | |
echo "Flags: ${{ steps.buildx.outputs.flags }}" | |
echo "Platforms: ${{ steps.buildx.outputs.platforms }}" | |
- name: Prepare | |
id: prepare | |
run: | | |
DOCKER_IMAGE=toncenter/ton-http-api | |
if ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
then | |
DOCKER_PLATFORMS=linux/amd64,linux/arm64 | |
else | |
DOCKER_PLATFORMS=linux/amd64,linux/arm64 | |
fi | |
VERSION=${{ needs.set_version.outputs.version }} | |
TAGS="-t ${DOCKER_IMAGE}:${VERSION} -t ${DOCKER_IMAGE}:latest" | |
echo "docker_image=${DOCKER_IMAGE}" >> $GITHUB_OUTPUT | |
echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
echo "buildx_args=--platform ${DOCKER_PLATFORMS} --no-cache ${TAGS} --file ton-http-api/.docker/Dockerfile ton-http-api" >> $GITHUB_OUTPUT | |
- name: Docker Buildx (build) | |
run: | | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes | |
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }} | |
- name: Login to DockerHub | |
if: success() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master' | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Docker Buildx (push) | |
if: success() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: | | |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }} | |
- name: Inspect image | |
if: always() && github.repository == 'toncenter/ton-http-api' && github.event_name == 'push' && github.ref == 'refs/heads/master' | |
run: | | |
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} |