Files
ReaderForSelfoss-multiplatform/.gitea/workflows/on_merge_on_release.yml
aminecmi c7f3dd6e5b
Some checks failed
Create tag / build (push) Successful in 7m34s
Create tag / createTagAndChangelog (push) Failing after 18s
chore: Gitea Action
2024-11-24 18:29:31 +01:00

58 lines
1.9 KiB
YAML

name: Create tag
on:
push:
branches:
- release
jobs:
build:
uses: ./.gitea/workflows/common_build.yml
createTagAndChangelog:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Config git
run: |
git config --global user.email aminecmi+giteadrone@pm.me
git config --global user.name Gitea
- name: Creating the tag
run: |
git fetch --tags -p
PREV=$(git describe --tags --abbrev=0)
./build.sh --publish --from-ci
- name: Generating changelog
run: |
VER=$(git describe --tags --abbrev=0)
CHANGELOG=$(git log $PREV..HEAD --pretty="- %s")
echo "**$VER**\n\n$CHANGELOG\n\n--------------------------------------------------------------------\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
git add CHANGELOG.md
git commit -m "Changelog for $VER"
git remote add deploy ${{ secrets.REMOTE_URL }}
- name: Push changes
uses: appleboy/git-push-action@v1.0.0
with:
followtags: true
ssh_key: ${{ secrets.PRIVATE_KEY }}
tags: true
branch: release
skip_verify: true
- name: copy file via ssh password
uses: appleboy/scp-action@v0.1.7
with:
host: amine-bouabdallaoui.fr
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
source: "version.txt"
target: /home/ubuntu/
- name: deploy version file
uses: appleboy/ssh-action@v1.2.0
with:
host: amine-bouabdallaoui.fr
username: ubuntu
key: ${{ secrets.PRIVATE_KEY }}
script: cd /home/ubuntu && sudo rm -rf /var/www/amine/version.txt && sudo chown www-data:www-data ./version.txt && sudo mv version.txt /var/www/amine/