feat(lb): make update idempotent #62
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
name: release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Unshallow | |
run: git fetch --prune --unshallow | |
- name: Highest tag | |
id: highestTag | |
run: | | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
echo highest=$(git tag | grep -E "^v?([0-9]+\.)+[0-9]+$" | sort -r -V | head -n1) >> $GITHUB_OUTPUT | |
- name: Enable experimental on dockerd | |
run: | | |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json | |
sudo service docker restart | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
version: latest | |
- name: Docker login | |
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin | |
- name: Get tag | |
uses: little-core-labs/[email protected] | |
id: tagName | |
- name: Make release | |
run: make release | |
env: | |
DOCKER_CLI_EXPERIMENTAL: enabled | |
TAG: ${{ steps.tagName.outputs.tag }} | |
IMAGE_TAG: ${{ steps.tagName.outputs.tag }} | |
- name: Push latest | |
if: steps.tagName.outputs.tag == steps.highestTag.outputs.highest | |
run: make release | |
env: | |
DOCKER_CLI_EXPERIMENTAL: enabled | |
TAG: ${{ steps.tagName.outputs.tag }} | |
IMAGE_TAG: latest |