1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/.github/workflows/blank.yml

145 lines
4.5 KiB
YAML
Raw Normal View History

2019-12-24 04:00:08 +08:00
name: docker-buildx
2019-12-21 02:12:34 +08:00
on:
pull_request:
branches: master
push:
branches: master
2019-12-30 07:43:52 +08:00
tags:
2019-12-30 07:50:47 +08:00
- '*.*'
2019-12-21 02:12:34 +08:00
jobs:
create-release:
runs-on: [ubuntu-latest]
steps:
-
name: Checkout
uses: actions/checkout@v1
2019-12-21 03:44:15 +08:00
-
2019-12-21 02:12:34 +08:00
name: Setup Node.js for use with actions
uses: actions/setup-node@v1.1.0
with:
version: 12
2019-12-21 03:44:15 +08:00
-
2019-12-21 02:12:34 +08:00
name: Install Deps
run: npm install --unsafe-perm
-
name: Create Release
run: npm run create-release -- --skip-opt-packages=ffmpeg,ffprobe --force-opt-packages
2019-12-21 02:12:34 +08:00
- uses: actions/upload-artifact@v1
with:
name: pigallery2-release
path: release
build-alpine:
2019-12-21 02:12:34 +08:00
runs-on: [ubuntu-latest]
needs: [create-release]
steps:
2019-12-30 07:43:52 +08:00
-
name: Set tag
id: vars
2019-12-30 07:50:03 +08:00
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) && echo ::set-output name=type::$(echo ${GITHUB_REF:5})
2019-12-21 02:12:34 +08:00
-
name: Checkout
uses: actions/checkout@v1
2019-12-21 03:44:15 +08:00
-
2019-12-21 02:12:34 +08:00
uses: actions/download-artifact@v1
with:
name: pigallery2-release
-
name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
-
name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
2019-12-21 03:44:15 +08:00
-
2019-12-21 02:12:34 +08:00
name: Docker login
run: |
docker login -u "${DOCKER_REGISTRY_USERNAME}" -p "${DOCKER_REGISTRY_PASSWORD}"
env:
DOCKER_REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
2019-12-21 02:19:27 +08:00
-
name: Run Buildx alpine
2019-12-30 07:50:03 +08:00
if: startsWith(steps.vars.outputs.type , 'head')
2019-12-21 02:19:27 +08:00
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/386,linux/arm/v6,linux/arm/v7 \
--output "type=image,push=true" \
--tag bpatrik/pigallery2:nightly-alpine \
--file docker/alpine/Dockerfile.build .
2019-12-30 07:43:52 +08:00
- name: Run Buildx alpine for tag
2019-12-30 07:50:03 +08:00
if: startsWith(steps.vars.outputs.type , 'tag')
2019-12-30 07:43:52 +08:00
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/386,linux/arm/v6,linux/arm/v7 \
--output "type=image,push=true" \
--tag bpatrik/pigallery2:nightly-alpine \
--tag bpatrik/pigallery2:$RELEASE_VERSION-alpine \
--tag bpatrik/pigallery2:latest-alpine \
--file docker/alpine/Dockerfile.build .
2019-12-21 03:44:15 +08:00
-
2019-12-21 02:12:34 +08:00
name: Docker logout
run: |
docker logout
build-stretch:
runs-on: [ubuntu-latest]
needs: [create-release]
steps:
2019-12-30 07:43:52 +08:00
-
name: Set tag
id: vars
2019-12-30 07:50:03 +08:00
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) && echo ::set-output name=type::$(echo ${GITHUB_REF:5})
-
name: Checkout
uses: actions/checkout@v1
-
uses: actions/download-artifact@v1
with:
name: pigallery2-release
-
name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
-
name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
-
name: Docker login
run: |
docker login -u "${DOCKER_REGISTRY_USERNAME}" -p "${DOCKER_REGISTRY_PASSWORD}"
env:
DOCKER_REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
-
name: Run Buildx stretch
2019-12-30 07:50:03 +08:00
if: startsWith(steps.vars.outputs.type , 'head')
2019-12-30 07:43:52 +08:00
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
--output "type=image,push=true" \
--tag bpatrik/pigallery2:nightly-stretch \
--file docker/debian-stretch/Dockerfile.build .
-
name: Run Buildx stretch for tag
2019-12-30 07:50:03 +08:00
if: startsWith(steps.vars.outputs.type , 'tag')
2019-12-30 07:43:52 +08:00
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
--output "type=image,push=true" \
--tag bpatrik/pigallery2:nightly-stretch \
2019-12-30 07:43:52 +08:00
--tag bpatrik/pigallery2:$RELEASE_VERSION \
--tag bpatrik/pigallery2:latest \
--file docker/debian-stretch/Dockerfile.build .
-
name: Docker logout
run: |
docker logout