This commit is contained in:
parent
f642f9fb6c
commit
83240245da
2 changed files with 72 additions and 0 deletions
22
.github/workflows/main.yml
vendored
Normal file
22
.github/workflows/main.yml
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
name: Build a dev image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch: {}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: [dev, amd64]
|
||||||
|
env:
|
||||||
|
IMAGE: gitea.ceperka.net/cx/pricepower
|
||||||
|
TAG: dev
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: docker login
|
||||||
|
run: |
|
||||||
|
docker login gitea.ceperka.net -u "${{ secrets.REGISTRY_DEV_USERNAME }}" -p "${{ secrets.REGISTRY_DEV_PASSWORD }}"
|
||||||
|
- name: Build
|
||||||
|
run: task build IMAGE=$IMAGE TAG=$TAG
|
||||||
|
- name: Push
|
||||||
|
run: task push IMAGE=$IMAGE TAG=$TAG
|
||||||
50
.github/workflows/release.yml
vendored
Normal file
50
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
name: Release of a new version
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Version to release'
|
||||||
|
required: true
|
||||||
|
default: 'latest'
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: [dev, amd64]
|
||||||
|
env:
|
||||||
|
IMAGE: gitea.ceperka.net/cx/pricepower
|
||||||
|
PULL_ENDPOINT: https://admin.rosti.cz/2/stacks/pull-with-token/7e74197e-a6f6-48f1-b84f-8bfbf451822a
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Figure out the tag
|
||||||
|
- name: Get git tag
|
||||||
|
id: get_tag
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||||
|
- name: Set version from input
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
|
run: echo "TAG_NAME=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Build
|
||||||
|
- name: docker login
|
||||||
|
run: docker login harbor.rosti.cz -u "${{ secrets.REGISTRY_DEV_USERNAME }}" -p "${{ secrets.REGISTRY_DEV_PASSWORD }}"
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: task build IMAGE=$IMAGE TAG=${{ env.TAG_NAME }}
|
||||||
|
|
||||||
|
- name: Tag latest
|
||||||
|
run: task tag-latest IMAGE=$IMAGE TAG=${{ env.TAG_NAME }}
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
run: task push IMAGE=$IMAGE TAG=${{ env.TAG_NAME }}
|
||||||
|
|
||||||
|
- name: Push latest
|
||||||
|
run: task push IMAGE=$IMAGE TAG=latest
|
||||||
|
|
||||||
|
# Deploy
|
||||||
|
- name: Call pull+up endpoint
|
||||||
|
run: curl $PULL_ENDPOINT
|
||||||
Loading…
Reference in a new issue