1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-11-20 01:52:32 +01:00
This commit is contained in:
GilbN 2022-04-02 14:09:44 +00:00
parent c376eeac5b
commit 068acc4f4a
2 changed files with 69 additions and 46 deletions

View File

@ -12,15 +12,17 @@ on:
options: options:
- master - master
- develop - develop
- testing
tag: tag:
description: 'Add a tag' description: 'Add a tag'
push: push:
branches: branches:
- develop - develop
- testing
paths-ignore: paths-ignore:
- '.github/**' - '.github/**'
jobs: jobs:
push_to_ghcr_io: build-and-push-it-to-the-limit:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
@ -30,61 +32,81 @@ jobs:
- name: Get the version - name: Get the version
id: get_version id: get_version
run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }} run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }}
- name: Set current date as env variable - name: Set current date as env variable
id: date_time id: date_time
run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S') run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S')
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: metadata
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/gilbn/theme.park
gilbn/theme.park
tags: |
type=ref,event=branch
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PAT }} password: ${{ secrets.GH_PAT }}
- name: build&push master
if: ${{ github.event.release.target_commitish == 'master' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park --tag ghcr.io/gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} .
docker push --all-tags ghcr.io/gilbn/theme.park
- name: manual build&push master
if: ${{ github.event.inputs.branch == 'master' }}
run: |
docker build --build-arg TP_RELEASE=${{ github.event.inputs.tag }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park --tag ghcr.io/gilbn/theme.park:${{ github.event.inputs.tag }} .
docker push --all-tags ghcr.io/gilbn/theme.park
- name: build&push develop
if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag ghcr.io/gilbn/theme.park:develop .
docker push --all-tags ghcr.io/gilbn/theme.park
push_to_dockerhub:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${{ github.event.release.tag_name }}
- name: Set current date as env variable
id: date_time
run: echo ::set-output name=NOW::$(date +'%Y-%m-%dT%H:%M:%S')
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DH_USER }} username: ${{ secrets.DH_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: build&push dh master
if: ${{ github.event.release.target_commitish == 'master' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park --tag gilbn/theme.park:${{ steps.get_version.outputs.VERSION }} .
docker push --all-tags gilbn/theme.park
- name: manual build&push dh master
if: ${{ github.event.inputs.branch == 'master' }}
run: |
docker build --build-arg TP_RELEASE=${{ github.event.inputs.tag }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park --tag gilbn/theme.park:${{ github.event.inputs.tag }} .
docker push --all-tags gilbn/theme.park
- name: build&push dh develop
if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }}
run: |
docker build --build-arg TP_RELEASE=${{ steps.get_version.outputs.VERSION }} --build-arg BUILD_DATE=${{ steps.date_time.outputs.NOW }} --tag gilbn/theme.park:develop .
docker push --all-tags gilbn/theme.park
- name: build&push master
if: ${{ github.event.release.target_commitish == 'master' }}
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: latest
labels: ${{ steps.metadata.outputs.labels }}
build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}
- name: manual build&push master
if: ${{ github.event.inputs.branch == 'master' }}
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: latest, ${{ github.event.inputs.tag }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}
- name: build&push develop
if: ${{ github.ref == 'refs/heads/develop' || github.event.inputs.branch == 'develop' }}
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}
- name: build&push testing
if: ${{ github.ref == 'refs/heads/testing' || github.event.inputs.branch == 'testing' }}
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: TP_RELEASE=${{ steps.get_version.outputs.VERSION }},BUILD_DATE=${{ steps.date_time.outputs.NOW }}

View File

@ -1,10 +1,11 @@
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.14 FROM --platform=${BUILDPLATFORM} ghcr.io/linuxserver/baseimage-alpine-nginx:3.14
# set version label # set version label
ARG BUILD_DATE ARG BUILD_DATE
ARG TP_RELEASE ARG TP_RELEASE
LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE} Platform: ${BUILDPLATFORM}"
LABEL maintainer="gilbn" LABEL maintainer="gilbn"
LABEL org.opencontainers.image.description DESCRIPTION
RUN \ RUN \
echo " ## Installing packages ## " && \ echo " ## Installing packages ## " && \