118 lines
3.4 KiB
YAML
Raw Normal View History

2023-03-28 18:57:22 +02:00
name: Build
on:
2023-05-11 01:28:41 +02:00
workflow_dispatch:
2023-03-28 18:57:22 +02:00
push:
2023-04-27 23:40:28 +02:00
branches:
- master
2023-04-03 00:36:30 +02:00
paths-ignore:
2023-04-03 14:08:07 +02:00
- '**/*.md'
- '**/*.yml'
2024-01-29 02:29:05 +01:00
- '**/*.js'
- '**/*.css'
- '**/*.html'
- 'web/**'
2023-04-16 06:29:19 +02:00
- '.gitignore'
- '.dockerignore'
2023-04-16 05:59:29 +02:00
- '.github/**'
- '.github/workflows/**'
2023-03-28 18:57:22 +02:00
2023-11-24 04:08:53 +01:00
concurrency:
group: build
cancel-in-progress: false
2023-03-28 18:57:22 +02:00
jobs:
2023-04-21 06:21:07 +02:00
shellcheck:
2023-04-30 07:09:25 +02:00
name: Check
2023-04-19 01:32:32 +02:00
uses: ./.github/workflows/check.yml
2023-03-28 18:57:22 +02:00
build:
2023-04-30 07:09:25 +02:00
name: Build
2023-04-21 07:55:32 +02:00
needs: shellcheck
2023-03-28 18:57:22 +02:00
runs-on: ubuntu-latest
2023-04-03 23:37:33 +02:00
permissions:
actions: write
2023-04-03 23:37:33 +02:00
packages: write
contents: read
2023-04-28 01:03:00 +02:00
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
2023-11-29 08:51:52 +01:00
fetch-depth: 0
2023-11-29 18:03:34 +01:00
-
name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
context: git
images: |
${{ secrets.DOCKERHUB_REPO }}
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,priority=100
type=raw,value=${{ vars.MAJOR }}.${{ vars.MINOR }}
labels: |
org.opencontainers.image.title=${{ vars.NAME }}
2023-11-30 13:53:00 +01:00
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login into Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
2023-11-29 18:03:34 +01:00
-
name: Build Docker image
2023-11-29 18:03:34 +01:00
uses: docker/build-push-action@v5
with:
context: .
push: true
provenance: false
2023-12-06 06:39:57 +01:00
platforms: linux/amd64,linux/arm64,linux/arm
2023-11-29 18:03:34 +01:00
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2023-11-30 14:04:47 +01:00
annotations: ${{ steps.meta.outputs.annotations }}
2023-11-29 18:03:34 +01:00
build-args: |
VERSION_ARG=${{ steps.meta.outputs.version }}
-
name: Create a release
uses: action-pack/github-release@v2
with:
2023-11-29 18:03:34 +01:00
tag: "v${{ steps.meta.outputs.version }}"
title: "v${{ steps.meta.outputs.version }}"
2023-12-14 03:45:32 +01:00
token: ${{ secrets.REPO_ACCESS_TOKEN }}
-
name: Increment version variable
uses: action-pack/bump@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
-
name: Push to Gitlab mirror
uses: action-pack/gitlab-sync@v3
with:
url: ${{ secrets.GITLAB_URL }}
token: ${{ secrets.GITLAB_TOKEN }}
username: ${{ secrets.GITLAB_USERNAME }}
2024-02-09 14:45:38 +01:00
-
name: Send mail
uses: action-pack/send-mail@v1
with:
to: ${{secrets.MAILTO}}
from: Github Actions <${{secrets.MAILTO}}>
connection_url: ${{secrets.MAIL_CONNECTION}}
subject: Build of ${{ github.event.repository.name }} v${{ steps.meta.outputs.version }} completed
body: |
The build job of ${{ github.event.repository.name }} v${{ steps.meta.outputs.version }} was completed successfully!
See https://github.com/${{ github.repository }}/actions for more information.