test pipeline

This commit is contained in:
d34dscene
2024-10-03 13:22:05 +02:00
parent b4c5aee4e7
commit 720b635309
2 changed files with 101 additions and 68 deletions

View File

@@ -1,68 +1,69 @@
name: Docker Build
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install dependencies
run: |
cd web
npm install
npm run build
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Disable for now
# name: Docker Build
#
# on:
# push:
# branches:
# - main
# tags:
# - 'v*'
# pull_request:
# branches:
# - main
#
# jobs:
# build:
# runs-on: ubuntu-latest
#
# permissions:
# contents: read
# packages: write
# attestations: write
# id-token: write
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Set up Node
# uses: actions/setup-node@v4
# with:
# node-version: 20.x
#
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
#
# - name: Install dependencies
# run: |
# cd web
# npm install
# npm run build
#
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: |
# ghcr.io/${{ github.repository }}
# tags: |
# type=raw,value=latest,enable={{is_default_branch}}
# type=semver,pattern={{version}}
#
# - name: Build and push
# uses: docker/build-push-action@v6
# with:
# context: .
# platforms: linux/amd64
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}