Skip to content

v1.26.0

v1.26.0 #814

Workflow file for this run

# Workflow for building and publishing this action's container image
name: Build and Publish
on:
push:
branches:
- main
- releases/*
pull_request: {}
release:
types:
- published
permissions:
contents: write
packages: write
jobs:
lint:
name: Lint, format and test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
node-modules-${{ runner.os }}
- name: Install dependencies
run: yarn install --frozen-lockfile --non-interactive
- name: Format
run: yarn format:check
- name: Lint
run: yarn lint
- name: Test
run: yarn test
publish:
name: Publish
runs-on: ubuntu-latest
concurrency: ${{ github.ref }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Docker metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: ghcr.io/alwaysmeticulous/report-diffs-action
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Configure GHCR credentials
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker build
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/alwaysmeticulous/report-diffs-action:cache
cache-to: type=registry,ref=ghcr.io/alwaysmeticulous/report-diffs-action:cache,mode=max
- name: Bump V1 tag
if: github.ref == 'refs/heads/releases/v1'
run: |
git fetch origin releases/v1 --tags
git tag --delete v1
git tag v1 origin/releases/v1
git push --tag --force