Skip to content

update workflows

update workflows #2

Workflow file for this run

name: Build image
on:
workflow_dispatch:
push:
branches: [master, minimal]
concurrency:
group: "build-image-${{ github.ref }}"
cancel-in-progress: true
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Build for production
run: npm run build
- name: Choose image name
id: image
run: |
owner=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
if [ "${{ github.ref_name }}" = "minimal" ]; then
echo "name=ghcr.io/${owner}/blockextensions-minimal" >> "$GITHUB_OUTPUT"
else
echo "name=ghcr.io/${owner}/blockextensions" >> "$GITHUB_OUTPUT"
fi
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Collect image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.image.outputs.name }}
tags: |
type=sha,format=short,prefix=sha-
type=raw,value=latest
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
push: true
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
SOURCE_URL=${{ github.server_url }}/${{ github.repository }}
REVISION=${{ github.sha }}