mirror of
https://github.com/EvilFreelancer/docker-routeros.git
synced 2025-07-15 17:14:41 +02:00
Add a github action that automatically create tag on master.
This action will add a tag matching ROUTEROS release once master pass the CI step after a push to master (can be the result of direct push, PR merge, ...). This tag being pushed will trigger the CD github action which will push the docker image that match this tag to docker hub.
This commit is contained in:
parent
75ebc85d1e
commit
30e74bd339
1 changed files with 36 additions and 0 deletions
36
.github/workflows/tag.yml
vendored
Normal file
36
.github/workflows/tag.yml
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
name: "Tag master with new version of RouterOS when CI pass"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: read
|
||||
|
||||
jobs:
|
||||
call_test:
|
||||
uses: EvilFreelancer/docker-routeros/.github/workflows/ci.yml@master
|
||||
|
||||
tag:
|
||||
name: "Add a tag to git"
|
||||
runs-on: "ubuntu-latest"
|
||||
needs: call_test
|
||||
if: always() && needs.call_test.result == 'success'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: '0'
|
||||
|
||||
- name: Add new tag on git
|
||||
run: |
|
||||
NEW_TAG=$(grep 'ROUTEROS_VERSION="' Dockerfile |cut -d '"' -f 2)
|
||||
git config user.name 'GitHub Actions'
|
||||
git config user.email 'github-actions@users.noreply.github.com'
|
||||
git tag "$NEW_TAG"
|
||||
|
||||
- name: Push new tag to git
|
||||
if: ${{ !env.ACT }}
|
||||
run: git push origin "$NEW_TAG"
|
Loading…
Add table
Add a link
Reference in a new issue