Try recommended workflow
This commit is contained in:
@@ -1,63 +1,61 @@
|
|||||||
name: Semantic Release and Changelog
|
name: ci
|
||||||
run-name: ${{ gitea.actor }} is running Semantic Release
|
|
||||||
on:
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 10 * * *"
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- "**"
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "main"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Patch:
|
docker:
|
||||||
name: Patch
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.1
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: '0'
|
# list of Docker images to use as base name for tags
|
||||||
- name: Minor version for each merge
|
images: |
|
||||||
id: taggerDryRun
|
name/app
|
||||||
uses: anothrNick/github-tag-action@1.67.0
|
# generate Docker tags based on the following events/attributes
|
||||||
env:
|
tags: |
|
||||||
GITHUB_TOKEN: ${{ secrets.REPO_PUSH_TOKEN }}
|
type=schedule
|
||||||
WITH_V: true
|
type=ref,event=branch
|
||||||
DRY_RUN: true
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
- name: echo new tag
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
run: |
|
type=semver,pattern={{major}}
|
||||||
echo "The next tag version will be: ${{ steps.taggerDryRun.outputs.new_tag }}"
|
type=sha
|
||||||
- name: echo tag
|
- name: Set up QEMU
|
||||||
run: |
|
uses: docker/setup-qemu-action@v3
|
||||||
echo "The current tag is: ${{ steps.taggerDryRun.outputs.tag }}"
|
- name: Set up Docker Buildx
|
||||||
- name: echo part
|
uses: docker/setup-buildx-action@v3
|
||||||
run: |
|
|
||||||
echo "The version increment was: ${{ steps.taggerDryRun.outputs.part }}"
|
|
||||||
|
|
||||||
Build-and-Publish:
|
|
||||||
name: Build and Publish
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4.1.1
|
|
||||||
|
|
||||||
- name: Login to Harbor
|
- name: Login to Harbor
|
||||||
uses: docker/login-action@v2.2.0
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: harbor.evanshome.io
|
registry: harbor.evanshome.io
|
||||||
username: "robot$registry-bot"
|
username: ${{ secrets.HARBOR_USERNAME }}
|
||||||
password: ${{ secrets.HARBOR_PASSWORD }}
|
password: ${{ secrets.HARBOR_PASSWORD }}
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: Build Docker image
|
|
||||||
run: docker build -t harbor.evanshome.io/library/py-eagle-mqtt:latest ./Docker/
|
|
||||||
|
|
||||||
- name: Minor version for each merge
|
|
||||||
id: taggerFinal
|
|
||||||
uses: anothrNick/github-tag-action@1.67.0
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.REPO_PUSH_TOKEN }}
|
|
||||||
WITH_V: true
|
|
||||||
GIT_API_TAGGING: false
|
|
||||||
|
|
||||||
- name: tag with name
|
|
||||||
run: docker tag harbor.evanshome.io/library/py-eagle-mqtt:latest harbor.evanshome.io/library/py-eagle-mqtt:${{ steps.taggerFinal.outputs.new_tag }}
|
|
||||||
|
|
||||||
- name: Push Docker image to Harbor
|
|
||||||
run: docker push --all-tags harbor.evanshome.io/library/py-eagle-mqtt
|
|
||||||
Reference in New Issue
Block a user