Remnashop - Release workflow (snoups/remnashop)
The Remnashop - Release workflow from snoups/remnashop, explained and optimized by Latchkey.
CI health: B - good
Point runs-on at Latchkey and get job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Remnashop - Release workflow from the snoups/remnashop repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Remnashop - Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: π§Ύ Checkout main branch
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: π Get latest tag
id: latest-tag
uses: JinoArch/get-latest-tag@latest
- name: π·οΈ Define Build Args
id: vars
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
IMAGE_REPO="ghcr.io/${GITHUB_REPOSITORY}"
IMAGE_TAGS="${IMAGE_REPO}:latest,${IMAGE_REPO}:${GITHUB_REF_NAME}"
echo "image_tag=${IMAGE_TAGS}" >> $GITHUB_OUTPUT
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "build_time=${BUILD_TIME}" >> $GITHUB_OUTPUT
echo "β
Tags: ${IMAGE_TAGS}"
echo "β
SHA: ${SHORT_SHA}"
- name: π οΈ Set Up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: π Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: ποΈ Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/snoups/remnashop:latest
ghcr.io/snoups/remnashop:${{ github.ref_name }}
build-args: |
BUILD_TIME=${{ steps.vars.outputs.build_time }}
BUILD_BRANCH=main
BUILD_COMMIT=${{ steps.vars.outputs.short_sha }}
BUILD_TAG=${{ github.ref_name }}
- name: π¦ Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
generate_release_notes: false
body: |
# π Remnashop ${{ github.ref_name }}
[](https://t.me/remna_shop)
[](https://t.me/+xQs17zMzwCY1NzYy)
---
- [Compare changes (${{ steps.latest-tag.outputs.previousTag }}...${{ steps.latest-tag.outputs.latestTag }})](https://github.com/snoups/remnashop/compare/${{ steps.latest-tag.outputs.previousTag }}...${{ steps.latest-tag.outputs.latestTag }})
---
## π³ Docker Images
### Latest:
```
ghcr.io/snoups/remnashop:latest
```
### Versioned:
```
ghcr.io/snoups/remnashop:${{ github.ref_name }}
```
draft: false
prerelease: false
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Remnashop - Release on: release: types: [published] workflow_dispatch: jobs: release: timeout-minutes: 30 runs-on: latchkey-small steps: - name: π§Ύ Checkout main branch uses: actions/checkout@v4 with: ref: main token: ${{ secrets.GITHUB_TOKEN }} - name: π Get latest tag id: latest-tag uses: JinoArch/get-latest-tag@latest - name: π·οΈ Define Build Args id: vars run: | SHORT_SHA=$(git rev-parse --short HEAD) BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") IMAGE_REPO="ghcr.io/${GITHUB_REPOSITORY}" IMAGE_TAGS="${IMAGE_REPO}:latest,${IMAGE_REPO}:${GITHUB_REF_NAME}" echo "image_tag=${IMAGE_TAGS}" >> $GITHUB_OUTPUT echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT echo "build_time=${BUILD_TIME}" >> $GITHUB_OUTPUT echo "β Tags: ${IMAGE_TAGS}" echo "β SHA: ${SHORT_SHA}" - name: π οΈ Set Up Docker Buildx uses: docker/setup-buildx-action@v3 - name: π Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GHCR_TOKEN }} - name: ποΈ Build and Push Docker Image uses: docker/build-push-action@v5 with: context: . push: true platforms: linux/amd64,linux/arm64 tags: | ghcr.io/snoups/remnashop:latest ghcr.io/snoups/remnashop:${{ github.ref_name }} build-args: | BUILD_TIME=${{ steps.vars.outputs.build_time }} BUILD_BRANCH=main BUILD_COMMIT=${{ steps.vars.outputs.short_sha }} BUILD_TAG=${{ github.ref_name }} - name: π¦ Create GitHub Release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} generate_release_notes: false body: | # π Remnashop ${{ github.ref_name }} [](https://t.me/remna_shop) [](https://t.me/+xQs17zMzwCY1NzYy) --- - [Compare changes (${{ steps.latest-tag.outputs.previousTag }}...${{ steps.latest-tag.outputs.latestTag }})](https://github.com/snoups/remnashop/compare/${{ steps.latest-tag.outputs.previousTag }}...${{ steps.latest-tag.outputs.latestTag }}) --- ## π³ Docker Images ### Latest: ``` ghcr.io/snoups/remnashop:latest ``` ### Versioned: ``` ghcr.io/snoups/remnashop:${{ github.ref_name }} ``` draft: false prerelease: false
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
5 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Container pulls and builds
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.