Set Ansible SSH retries to 8 #98
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, tag and release | |
on: | |
push: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build_image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Pulling Catapult repository... | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Logging into to GitHub Container Registry... | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Installing QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Getting current version... | |
run: | | |
VERSION=$(cat version.yml | cut -d ' ' -f 2) | |
echo "IMAGE_VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Building Catapult image... | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
file: ./Dockerfile | |
build-args: | | |
VERSION=${{ env.IMAGE_VERSION }} | |
push: true | |
tags: | | |
ghcr.io/clarifiedsecurity/catapult:latest | |
ghcr.io/clarifiedsecurity/catapult:main | |
ghcr.io/clarifiedsecurity/catapult:${{ env.IMAGE_VERSION }} | |
ghcr.io/clarifiedsecurity/catapult:v${{ env.IMAGE_VERSION }} | |
tag_and_release: | |
needs: build_image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cloning the repository repo... | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Creating a tag and a release | |
run: | | |
VERSION_FILE="version.yml" | |
VERSION=$(cat $VERSION_FILE | grep "version:" | cut -d " " -f 2) | |
CURRENT_TAG=$(git tag --sort=-creatordate | head -n 1) | |
TAG_NAME="v$VERSION" | |
echo "LATEST_TAG=$TAG_NAME" >> $GITHUB_ENV | |
# Tagging and pushing the change | |
git tag $TAG_NAME | |
git push origin $TAG_NAME | |
# Creating temp changelog file | |
git log $CURRENT_TAG..$TAG_NAME --pretty=format:"- %s" > CHANGELOG.md | |
- name: Releasing a new version... | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ env.LATEST_TAG }} | |
bodyFile: CHANGELOG.md |