first commit
This commit is contained in:
commit
6d946aa7c8
3 changed files with 178 additions and 0 deletions
68
.github/workflows/build-monorepo.yaml
vendored
Normal file
68
.github/workflows/build-monorepo.yaml
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
name: Build and push
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
PACKAGE_WRITER_USERNAME:
|
||||
required: true
|
||||
type: string
|
||||
PROJECT_ID:
|
||||
required: true
|
||||
type: string
|
||||
jobs:
|
||||
build:
|
||||
name: Build and push
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set current time
|
||||
uses: https://github.com/gerred/actions/current-time@master
|
||||
id: current_time
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ vars.IMAGE_BASE_PATH }}/${{ inputs.PROJECT_ID }}
|
||||
tags: |
|
||||
type=ref,event=branch,branch=dev,suffix=-{{sha}},optional=true
|
||||
type=ref,event=branch,branch=dev,value=dev,optional=true
|
||||
type=match,event=tag,pattern=_v(.*),group=1,prefix=v,optional=true
|
||||
|
||||
- name: Print (debug) Docker meta JSON
|
||||
uses: https://github.com/actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const json = JSON.parse(process.env.JSON_STRING);
|
||||
console.log("------------------------------------------------------------");
|
||||
console.log("Docker Meta JSON Output:");
|
||||
console.log("");
|
||||
console.log(JSON.stringify(json, null, 2));
|
||||
console.log("");
|
||||
console.log("------------------------------------------------------------");
|
||||
env:
|
||||
JSON_STRING: ${{ steps.meta.outputs.json }}
|
||||
|
||||
- name: Login into gitea registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.kvant.cloud
|
||||
username: ${{ inputs.PACKAGE_WRITER_USERNAME }}
|
||||
password: ${{ secrets.PACKAGE_WRITER_TOKEN }}
|
||||
|
||||
- name: Build container and push to registry
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
file: ./docker/Dockerfile
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
progress=plain
|
||||
PROJECT_ID=${{ inputs.PROJECT_ID }}
|
||||
TURBO_TEAM=${{ vars.TURBO_TEAM }}
|
||||
TURBO_API=${{ vars.TURBO_API }}
|
||||
TURBO_TOKEN=${{ secrets.TURBO_TOKEN }}
|
||||
FONTAWESOME_PACKAGE_TOKEN=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
|
||||
IMAGE_TAG=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
||||
VCS_REF=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
||||
BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
|
||||
61
.github/workflows/build-standalone.yaml
vendored
Normal file
61
.github/workflows/build-standalone.yaml
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
name: Build and push
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
PACKAGE_WRITER_USERNAME:
|
||||
required: true
|
||||
type: string
|
||||
jobs:
|
||||
build:
|
||||
name: Build and push
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set current time
|
||||
uses: https://github.com/gerred/actions/current-time@master
|
||||
id: current_time
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ vars.IMAGE_PATH }}
|
||||
tags: |
|
||||
type=ref,event=branch,branch=dev,suffix=-{{sha}},optional=true
|
||||
type=ref,event=branch,branch=dev,value=dev,optional=true
|
||||
type=match,event=tag,pattern=_v(.*),group=1,prefix=v,optional=true
|
||||
|
||||
- name: Print (debug) Docker meta JSON
|
||||
uses: https://github.com/actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const json = JSON.parse(process.env.JSON_STRING);
|
||||
console.log("------------------------------------------------------------");
|
||||
console.log("Docker Meta JSON Output:");
|
||||
console.log("");
|
||||
console.log(JSON.stringify(json, null, 2));
|
||||
console.log("");
|
||||
console.log("------------------------------------------------------------");
|
||||
env:
|
||||
JSON_STRING: ${{ steps.meta.outputs.json }}
|
||||
|
||||
- name: Login into gitea registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.kvant.cloud
|
||||
username: ${{ inputs.PACKAGE_WRITER_USERNAME }}
|
||||
password: ${{ secrets.PACKAGE_WRITER_TOKEN }}
|
||||
|
||||
- name: Build container and push to registry
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
file: ./docker/Dockerfile
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
progress=plain
|
||||
FONTAWESOME_PACKAGE_TOKEN=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
|
||||
IMAGE_TAG=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
||||
VCS_REF=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
||||
BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue