mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
adding tag support for workflow
This commit is contained in:
parent
720e9b60b1
commit
8fd13935b6
37
.github/workflows/blank.yml
vendored
37
.github/workflows/blank.yml
vendored
@ -4,6 +4,8 @@ on:
|
|||||||
branches: master
|
branches: master
|
||||||
push:
|
push:
|
||||||
branches: master
|
branches: master
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-release:
|
create-release:
|
||||||
@ -31,6 +33,10 @@ jobs:
|
|||||||
runs-on: [ubuntu-latest]
|
runs-on: [ubuntu-latest]
|
||||||
needs: [create-release]
|
needs: [create-release]
|
||||||
steps:
|
steps:
|
||||||
|
-
|
||||||
|
name: Set tag
|
||||||
|
id: vars
|
||||||
|
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
@ -56,12 +62,25 @@ jobs:
|
|||||||
DOCKER_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
DOCKER_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
-
|
-
|
||||||
name: Run Buildx alpine
|
name: Run Buildx alpine
|
||||||
|
if: startsWith(steps.vars.outputs.tag, 'master')
|
||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform linux/amd64,linux/arm64,linux/386,linux/arm/v6,linux/arm/v7 \
|
--platform linux/amd64,linux/arm64,linux/386,linux/arm/v6,linux/arm/v7 \
|
||||||
--output "type=image,push=true" \
|
--output "type=image,push=true" \
|
||||||
--tag bpatrik/pigallery2:nightly-alpine \
|
--tag bpatrik/pigallery2:nightly-alpine \
|
||||||
--file docker/alpine/Dockerfile.build .
|
--file docker/alpine/Dockerfile.build .
|
||||||
|
- name: Run Buildx alpine for tag
|
||||||
|
if: startsWith(steps.vars.outputs.tag, 'v')
|
||||||
|
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 .
|
||||||
-
|
-
|
||||||
name: Docker logout
|
name: Docker logout
|
||||||
run: |
|
run: |
|
||||||
@ -70,6 +89,10 @@ jobs:
|
|||||||
runs-on: [ubuntu-latest]
|
runs-on: [ubuntu-latest]
|
||||||
needs: [create-release]
|
needs: [create-release]
|
||||||
steps:
|
steps:
|
||||||
|
-
|
||||||
|
name: Set tag
|
||||||
|
id: vars
|
||||||
|
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
@ -95,12 +118,26 @@ jobs:
|
|||||||
DOCKER_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
DOCKER_REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
-
|
-
|
||||||
name: Run Buildx stretch
|
name: Run Buildx stretch
|
||||||
|
if: startsWith(steps.vars.outputs.tag, 'master')
|
||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
--platform linux/amd64,linux/arm64,linux/arm/v7 \
|
||||||
--output "type=image,push=true" \
|
--output "type=image,push=true" \
|
||||||
--tag bpatrik/pigallery2:nightly-stretch \
|
--tag bpatrik/pigallery2:nightly-stretch \
|
||||||
--file docker/debian-stretch/Dockerfile.build .
|
--file docker/debian-stretch/Dockerfile.build .
|
||||||
|
-
|
||||||
|
name: Run Buildx stretch for tag
|
||||||
|
if: startsWith(steps.vars.outputs.tag, 'v')
|
||||||
|
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 \
|
||||||
|
--tag bpatrik/pigallery2:$RELEASE_VERSION \
|
||||||
|
--tag bpatrik/pigallery2:latest \
|
||||||
|
--file docker/debian-stretch/Dockerfile.build .
|
||||||
-
|
-
|
||||||
name: Docker logout
|
name: Docker logout
|
||||||
run: |
|
run: |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user