feat(ci): create file sync and auto merge bot workflows #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow is an example of a combination of automatic and manual release. | |
# The triggers are: | |
# - Push | |
# - Workflow Dispatch | |
# | |
# This workflow uses the `if` conditions to control when the CI runs versus when | |
# a release is also created. | |
# | |
# The CI runs when pull requests are created and also when code is merged into | |
# main, i.e. push events to main. | |
# | |
# Lastly, it will trigger from manually workflow dispatches. | |
name: CI and Release | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
version: | |
# Friendly description to be shown in the UI instead of 'name' | |
description: "Semver type of new version (major / minor / patch)" | |
# Input has to be provided for the workflow to run | |
required: true | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
# Example for docker file linting | |
# hadolint: | |
# uses: rollkit/.github/.github/workflows/reusable_dockerfile_lint.yml@master | |
yamllint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/yamllint | |
markdown-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/markdown-lint | |
# Make a release if | |
# - there were changes and this is a scheduled job | |
# - This is a manually trigger job, i.e. workflow_dispatch | |
release: | |
needs: [yamllint, markdown-lint] | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
permissions: "write-all" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Version Release | |
uses: ./.github/actions/version-release | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
version-bump: ${{inputs.version}} | |
# Example for docker builds | |
# docker: | |
# needs: release | |
# name: Build and Push Docker image to Docker Hub | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Check out the repo | |
# uses: actions/checkout@v4 | |
# - uses: rollkit/.github/.github/actions/docker-publish@master | |
# with: | |
# docker_username: ${{ secrets.DOCKER_USERNAME}} | |
# docker_password: ${{ secrets.DOCKER_PASSWORD}} | |
# docker_repository: <update> | |
# semver_version: ${{ needs.release.outputs.new_version }} |