2019-12-23 22:00:08 +02:00
|
|
|
name: docker-buildx
|
2019-12-20 20:12:34 +02:00
|
|
|
on:
|
|
|
|
pull_request:
|
2021-05-13 10:01:52 +02:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- experimental
|
2019-12-20 20:12:34 +02:00
|
|
|
push:
|
2021-05-13 10:01:52 +02:00
|
|
|
branches:
|
2022-02-07 17:38:37 +02:00
|
|
|
- '**'
|
2019-12-30 01:43:52 +02:00
|
|
|
tags:
|
2019-12-30 01:50:47 +02:00
|
|
|
- '*.*'
|
2019-12-20 20:12:34 +02:00
|
|
|
|
|
|
|
jobs:
|
2020-01-08 23:44:47 +02:00
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
2020-09-06 14:58:02 +02:00
|
|
|
|
2020-01-08 23:44:47 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-01-15 12:40:43 +02:00
|
|
|
node-version: [14.x]
|
2020-09-06 14:58:02 +02:00
|
|
|
|
2020-01-29 14:15:02 +02:00
|
|
|
services:
|
|
|
|
mariadb:
|
|
|
|
image: mariadb:latest
|
|
|
|
ports:
|
2020-01-29 17:15:39 +02:00
|
|
|
- 3306
|
2020-01-29 14:15:02 +02:00
|
|
|
env:
|
|
|
|
MYSQL_USER: user
|
|
|
|
MYSQL_PASSWORD: password
|
2020-01-30 00:02:07 +02:00
|
|
|
MYSQL_DATABASE: pigallery_test
|
2020-01-29 14:15:02 +02:00
|
|
|
MYSQL_ROOT_PASSWORD: password
|
|
|
|
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
|
|
|
|
2020-01-08 23:44:47 +02:00
|
|
|
|
|
|
|
steps:
|
2020-12-25 11:54:28 +02:00
|
|
|
- uses: actions/checkout@v2
|
2020-01-08 23:44:47 +02:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2020-12-25 11:54:28 +02:00
|
|
|
uses: actions/setup-node@v2
|
2020-01-08 23:44:47 +02:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2020-09-06 14:58:02 +02:00
|
|
|
|
2020-01-29 14:15:02 +02:00
|
|
|
- name: Verify MariaDB connection
|
|
|
|
env:
|
|
|
|
PORT: ${{ job.services.mariadb.ports[3306] }}
|
|
|
|
run: |
|
|
|
|
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
|
|
|
|
sleep 1
|
2020-09-06 14:58:02 +02:00
|
|
|
done
|
|
|
|
|
2021-05-16 07:46:26 +02:00
|
|
|
- name: npm install and build
|
2020-01-08 23:44:47 +02:00
|
|
|
run: |
|
|
|
|
npm ci
|
2021-05-16 07:46:26 +02:00
|
|
|
npm run build
|
|
|
|
|
|
|
|
- name: tslint
|
|
|
|
run: |
|
|
|
|
npm run lint
|
|
|
|
- name: test
|
|
|
|
run: |
|
2020-01-08 23:44:47 +02:00
|
|
|
npm test
|
|
|
|
env:
|
2020-01-29 14:15:02 +02:00
|
|
|
MYSQL_HOST: localhost
|
2020-01-30 00:14:46 +02:00
|
|
|
MYSQL_USERNAME: root
|
2020-01-29 14:15:02 +02:00
|
|
|
MYSQL_PASSWORD: password
|
2020-01-29 17:15:39 +02:00
|
|
|
MYSQL_PORT: ${{ job.services.mariadb.ports[3306] }}
|
2020-01-29 13:29:25 +02:00
|
|
|
PORT: 35000
|
2020-01-08 23:44:47 +02:00
|
|
|
CI: true
|
2020-09-06 14:58:02 +02:00
|
|
|
|
2019-12-20 20:12:34 +02:00
|
|
|
create-release:
|
|
|
|
runs-on: [ubuntu-latest]
|
2020-01-08 23:44:47 +02:00
|
|
|
needs: [test]
|
2019-12-20 20:12:34 +02:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-12-25 11:54:28 +02:00
|
|
|
uses: actions/checkout@v2
|
2019-12-20 21:44:15 +02:00
|
|
|
-
|
2019-12-20 20:12:34 +02:00
|
|
|
name: Setup Node.js for use with actions
|
2020-12-25 11:54:28 +02:00
|
|
|
uses: actions/setup-node@v2
|
2019-12-20 20:12:34 +02:00
|
|
|
with:
|
2022-01-15 12:32:46 +02:00
|
|
|
node-version: 12
|
2019-12-20 21:44:15 +02:00
|
|
|
-
|
2019-12-20 20:12:34 +02:00
|
|
|
name: Install Deps
|
|
|
|
run: npm install --unsafe-perm
|
|
|
|
-
|
|
|
|
name: Create Release
|
2022-01-15 12:39:25 +02:00
|
|
|
run: npm run create-release -- --skip-opt-packages=ffmpeg-static,ffprobe-static --force-opt-packages
|
2020-12-25 11:54:28 +02:00
|
|
|
- uses: actions/upload-artifact@v2
|
2019-12-20 20:12:34 +02:00
|
|
|
with:
|
|
|
|
name: pigallery2-release
|
|
|
|
path: release
|
2022-03-11 14:21:29 +02:00
|
|
|
build-dockerx:
|
2022-02-07 20:58:46 +02:00
|
|
|
runs-on: [ ubuntu-latest ]
|
|
|
|
needs: [ create-release ]
|
2021-05-09 23:27:17 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-03-11 14:21:29 +02:00
|
|
|
container: [alpine, debian-buster, debian-bullseye ]
|
2021-05-13 10:01:52 +02:00
|
|
|
|
2020-01-01 15:15:15 +02:00
|
|
|
steps:
|
2022-02-07 20:58:46 +02:00
|
|
|
- name: Set tag
|
2020-01-01 15:15:15 +02:00
|
|
|
id: vars
|
|
|
|
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) && echo ::set-output name=type::$(echo ${GITHUB_REF:5})
|
2022-02-07 20:58:46 +02:00
|
|
|
- name: Checkout
|
2020-12-25 11:54:28 +02:00
|
|
|
uses: actions/checkout@v2
|
2022-02-07 20:58:46 +02:00
|
|
|
- uses: actions/download-artifact@v2
|
2020-01-01 15:15:15 +02:00
|
|
|
with:
|
2020-12-26 13:11:31 +02:00
|
|
|
name: pigallery2-release
|
|
|
|
path: pigallery2-release
|
2022-02-07 20:58:46 +02:00
|
|
|
- name: Set up QEMU
|
2020-12-25 16:31:59 +02:00
|
|
|
uses: docker/setup-qemu-action@v1
|
2022-02-07 20:58:46 +02:00
|
|
|
- name: Set up Docker Buildx
|
2020-12-25 11:54:28 +02:00
|
|
|
uses: docker/setup-buildx-action@v1
|
2022-02-07 20:58:46 +02:00
|
|
|
- name: Login to DockerHub
|
2020-12-26 13:11:31 +02:00
|
|
|
uses: docker/login-action@v1
|
2020-12-25 16:31:59 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
2020-12-26 13:11:31 +02:00
|
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
2022-03-10 21:35:32 +02:00
|
|
|
- name: Build docker
|
2022-02-07 20:58:46 +02:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: docker/${{ matrix.container }}/Dockerfile.build
|
2022-03-11 14:21:29 +02:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
2022-03-10 21:35:32 +02:00
|
|
|
- name: Push experimental
|
2022-02-07 20:58:46 +02:00
|
|
|
if: ${{ github.ref == 'refs/heads/experimental' }}
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: docker/${{ matrix.container }}/Dockerfile.build
|
2022-03-11 14:21:29 +02:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
2022-02-07 20:58:46 +02:00
|
|
|
push: true
|
|
|
|
tags: bpatrik/pigallery2:experimental-${{ matrix.container }}
|
2022-03-10 21:35:32 +02:00
|
|
|
- name: Push nightly on new master commit
|
2022-02-07 20:58:46 +02:00
|
|
|
if: ${{ startsWith(steps.vars.outputs.type , 'head') && !github.event.issue.pull_request && github.ref == 'refs/heads/master' }}
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: docker/${{ matrix.container }}/Dockerfile.build
|
2022-03-11 14:21:29 +02:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
2022-02-07 20:58:46 +02:00
|
|
|
push: true
|
|
|
|
tags: bpatrik/pigallery2:nightly-${{ matrix.container }}
|
2022-03-10 21:35:32 +02:00
|
|
|
- name: Push release on new Tag
|
2022-03-11 14:32:38 +02:00
|
|
|
if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request && matrix.container != 'debian-buster'}}
|
2022-02-07 20:58:46 +02:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: docker/${{ matrix.container }}/Dockerfile.build
|
2022-03-11 14:21:29 +02:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
2022-02-07 20:58:46 +02:00
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
bpatrik/pigallery2:nightly-${{ matrix.container }}
|
2022-03-11 14:30:04 +02:00
|
|
|
bpatrik/pigallery2:${{ steps.vars.outputs.tag }}-${{ matrix.container }}
|
|
|
|
bpatrik/pigallery2:latest-${{ matrix.container }}
|
|
|
|
- name: Push latest on new Tag
|
2022-03-11 14:32:38 +02:00
|
|
|
if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request && matrix.container == 'debian-buster'}}
|
2020-12-25 16:31:59 +02:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
2021-05-09 23:27:17 +02:00
|
|
|
file: docker/${{ matrix.container }}/Dockerfile.build
|
2020-12-26 13:11:31 +02:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
|
|
push: true
|
|
|
|
tags: |
|
2021-05-09 23:27:17 +02:00
|
|
|
bpatrik/pigallery2:nightly-${{ matrix.container }}
|
2022-02-07 20:58:46 +02:00
|
|
|
bpatrik/pigallery2:${{ steps.vars.outputs.tag }}
|
|
|
|
bpatrik/pigallery2:latest
|