Skip to content

Commit

Permalink
ci: Use reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
geokrety-bot committed Aug 8, 2023
1 parent fb81737 commit e477b8e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 110 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@ on:
pull_request:
push:
branches:
- '*'
- '!main'

jobs:

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4

- uses: pre-commit/[email protected]
call-pre-commit:
uses: geokrety/geokrety-gha-workflows/.github/workflows/pre-commit.yml@v1
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Automatic release

on:
push:
branches:
- main

jobs:
call-pre-commit:
uses: geokrety/geokrety-gha-workflows/.github/workflows/release.yml@v1
with:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
45 changes: 0 additions & 45 deletions .github/workflows/semantic-release.yml

This file was deleted.

58 changes: 3 additions & 55 deletions .github/workflows/version-set.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,7 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout current code
uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: geokrety/geokrety-gha-workflows/.github/workflows/version-set.yml@v1
with:
path: 'source'

- name: Get values
id: vars
run: |
echo "version=${GITHUB_REF_NAME#v}" | tee -a $GITHUB_OUTPUT
[ -f source/.versionset ] || { echo ".versionset file missing"; exit 1; }
echo "version_set_name=$(cat source/.versionset)" | tee -a $GITHUB_OUTPUT
- name: Checkout ansible repo
uses: actions/checkout@v3
with:
path: 'versionset'
repository: geokrety/geokrety-ansible

- name: Update Version-Set
uses: fjogeleit/yaml-update-action@main
with:
commitChange: false
createPR: false
repository: geokrety/geokrety-ansible
valueFile: defaults/versionset.yml
changes: |
{
"${{ steps.vars.outputs.version_set_name }}.docker_tag": "${{ steps.vars.outputs.version }}",
"${{ steps.vars.outputs.version_set_name }}.git_url": "${{ github.server_url }}/${{ github.repository }}"
}
workDir: versionset

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
path: versionset
token: ${{ secrets.GH_TOKEN }}
add-paths: defaults/versionset.yml
commit-message: |
feat: Bump ${{ github.repository }} in version-set to ${{ github.ref_name }}
committer: geokrety-bot <[email protected]>
author: geokrety-bot <[email protected]>
branch: deployment/${{ github.repository }}
delete-branch: true
title: |
Bump ${{ github.repository }} in version-set
labels: version-set
assignees: kumy
reviewers: kumy

- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
GH_TOKEN: ${{ secrets.GH_TOKEN }}

0 comments on commit e477b8e

Please sign in to comment.