Skip to content
Latchkey

Remnashop - Dev workflow (snoups/remnashop)

The Remnashop - Dev workflow from snoups/remnashop, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: snoups/remnashop.github/workflows/dev-docker-release.ymlLicense MITView source

What it does

This is the Remnashop - Dev 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

workflow (.yml)
name: Remnashop - Dev

on:
  push:
    branches:
      - dev

jobs:
  docker-build:
    name: πŸ—οΈ Build and Push Docker Image
    runs-on: ubuntu-latest

    outputs:
      image_tag: ${{ steps.vars.outputs.image_tag }}
      short_sha: ${{ steps.vars.outputs.short_sha }}

    steps:
      - name: 🧾 Checkout Repository
        uses: actions/checkout@v4

      - 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: 🏷️ Define Tags & Outputs
        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}:dev,${IMAGE_REPO}:dev-${SHORT_SHA}"

          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: πŸ—οΈ Build and Push Image
        uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          platforms: linux/amd64,linux/arm64
          tags: ${{ steps.vars.outputs.image_tag }}
          build-args: |
            BUILD_TIME=${{ steps.vars.outputs.build_time }}
            BUILD_BRANCH=${{ github.ref_name }}
            BUILD_COMMIT=${{ steps.vars.outputs.short_sha }}
            BUILD_TAG=dev

  release:
    name: πŸ“¦ Build and Publish Dev Artifact
    runs-on: ubuntu-latest
    needs: docker-build

    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      SHORT_SHA: ${{ needs.docker-build.outputs.short_sha }}

    steps:
      - name: 🧾 Checkout Repository
        uses: actions/checkout@v4

      - name: 🧱 Generate Build Metadata
        run: |
          BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
          BRANCH="${{ github.ref_name }}"
          FULL_SHA="${{ github.sha }}"
          COMMIT_URL="https://github.com/${{ github.repository }}/commit/$SHORT_SHA"

          TAG_VALUE=$(grep -m1 '"version":' package.json | cut -d'"' -f4 || true)
          if [ -z "$TAG_VALUE" ]; then
            JSON_TAG="null"
          else
            JSON_TAG="\"$TAG_VALUE\""
          fi

          cat <<EOF > build.info.json
          {
            "buildTime": "$BUILD_TIME",
            "commitFull": "$FULL_SHA",
            "commit": "$SHORT_SHA",
            "tag": $JSON_TAG,
            "branch": "$BRANCH",
            "commitUrl": "$COMMIT_URL"
          }
          EOF
          echo "βœ… Generated build.info.json"

      - name: πŸ“ Archive Project Files
        run: |
          zip -r remnashop-dev.zip . \
            -x ".git/*" ".github/*" "logs/*" "*.zip" "node_modules/*"

      - name: 🧹 Remove Previous Artifact
        continue-on-error: true
        run: gh release delete-asset dev-build remnashop-dev.zip || true

      - name: ⬆️ Upload Artifact to Release
        run: gh release upload dev-build remnashop-dev.zip --clobber

      - name: πŸ“ Update Release Notes
        run: |
          COMMIT_URL="https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
          DATE=$(date -u +'%Y-%m-%d %H:%M:%S UTC')

          gh release edit dev-build --notes-file - <<EOF
          πŸ” Updated development build
          πŸ”— [Commit]($COMMIT_URL)
          🏷️ Tags:
          β€’ \`dev\`
          β€’ \`dev-$SHORT_SHA\`
          πŸ“… Built: $DATE
          EOF

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Remnashop - Dev
 
on:
  push:
    branches:
      - dev
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  docker-build:
    timeout-minutes: 30
    name: πŸ—οΈ Build and Push Docker Image
    runs-on: latchkey-small
 
    outputs:
      image_tag: ${{ steps.vars.outputs.image_tag }}
      short_sha: ${{ steps.vars.outputs.short_sha }}
 
    steps:
      - name: 🧾 Checkout Repository
        uses: actions/checkout@v4
 
      - 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: 🏷️ Define Tags & Outputs
        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}:dev,${IMAGE_REPO}:dev-${SHORT_SHA}"
 
          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: πŸ—οΈ Build and Push Image
        uses: docker/build-push-action@v5
        with:
          context: .
          push: true
          platforms: linux/amd64,linux/arm64
          tags: ${{ steps.vars.outputs.image_tag }}
          build-args: |
            BUILD_TIME=${{ steps.vars.outputs.build_time }}
            BUILD_BRANCH=${{ github.ref_name }}
            BUILD_COMMIT=${{ steps.vars.outputs.short_sha }}
            BUILD_TAG=dev
 
  release:
    timeout-minutes: 30
    name: πŸ“¦ Build and Publish Dev Artifact
    runs-on: latchkey-small
    needs: docker-build
 
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      SHORT_SHA: ${{ needs.docker-build.outputs.short_sha }}
 
    steps:
      - name: 🧾 Checkout Repository
        uses: actions/checkout@v4
 
      - name: 🧱 Generate Build Metadata
        run: |
          BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
          BRANCH="${{ github.ref_name }}"
          FULL_SHA="${{ github.sha }}"
          COMMIT_URL="https://github.com/${{ github.repository }}/commit/$SHORT_SHA"
 
          TAG_VALUE=$(grep -m1 '"version":' package.json | cut -d'"' -f4 || true)
          if [ -z "$TAG_VALUE" ]; then
            JSON_TAG="null"
          else
            JSON_TAG="\"$TAG_VALUE\""
          fi
 
          cat <<EOF > build.info.json
          {
            "buildTime": "$BUILD_TIME",
            "commitFull": "$FULL_SHA",
            "commit": "$SHORT_SHA",
            "tag": $JSON_TAG,
            "branch": "$BRANCH",
            "commitUrl": "$COMMIT_URL"
          }
          EOF
          echo "βœ… Generated build.info.json"
 
      - name: πŸ“ Archive Project Files
        run: |
          zip -r remnashop-dev.zip . \
            -x ".git/*" ".github/*" "logs/*" "*.zip" "node_modules/*"
 
      - name: 🧹 Remove Previous Artifact
        continue-on-error: true
        run: gh release delete-asset dev-build remnashop-dev.zip || true
 
      - name: ⬆️ Upload Artifact to Release
        run: gh release upload dev-build remnashop-dev.zip --clobber
 
      - name: πŸ“ Update Release Notes
        run: |
          COMMIT_URL="https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
          DATE=$(date -u +'%Y-%m-%d %H:%M:%S UTC')
 
          gh release edit dev-build --notes-file - <<EOF
          πŸ” Updated development build
          πŸ”— [Commit]($COMMIT_URL)
          🏷️ Tags:
          β€’ \`dev\`
          β€’ \`dev-$SHORT_SHA\`
          πŸ“… Built: $DATE
          EOF
 

What changed

3 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:

This workflow runs 2 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow