rancher-partner-charts/.github/workflows/daily.yaml

72 lines
2.5 KiB
YAML
Raw Normal View History

2023-01-18 20:52:05 +00:00
# Authors: Samuel Attwood, Nefi Munoz
name: Partner Charts CI
on:
workflow_dispatch:
# push:
# branches:
# - main-source
jobs:
2023-07-05 18:41:27 +00:00
sync: #this job should run first
2023-01-18 20:52:05 +00:00
runs-on: ubuntu-latest
2023-07-05 18:41:27 +00:00
steps:
- name: Checkout main-source branch
uses: actions/checkout@v3
with:
ref: main-source # branch you want to sync
repository: nflondo/partner-charts # your forked repository URL
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch upstream changes for main-source branch
run: |
git remote add upstream https://github.com/rancher/partner-charts.git # URL of upstream repository
git fetch upstream main-source
- name: Merge upstream changes into main-source branch
run: |
git checkout main-source
git merge upstream/main-source --allow-unrelated-histories --no-edit
git push origin main-source
- name: Merge upstream changes into main branch
run: |
git fetch upstream main # this fetch is necessary here
git checkout main
git merge upstream/main --allow-unrelated-histories --no-edit
git push origin main
2023-01-18 20:52:05 +00:00
2023-07-05 18:41:27 +00:00
build:
needs: sync #this job should run after "sync" job
runs-on: ubuntu-latest
2023-01-18 20:52:05 +00:00
steps:
- name: Checkout main-source branch
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '>=1.17.0'
- name: Run CI
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
2023-07-11 20:50:40 +00:00
git config --global pull.rebase false # merge (this is the default)
2023-01-18 20:52:05 +00:00
scripts/pull-ci-scripts
2023-07-14 16:46:35 +00:00
bin/partner-charts-ci auto
git pull origin main-source
2023-01-18 20:52:05 +00:00
git push origin main-source
- name: Update main branch
run: |
# checkout action is only going to fetch the current branch, so "git checkout main" would fail if we dont fetch main first
git fetch origin main --depth 1
git checkout main
rm -r assets index.yaml
git checkout main-source -- index.yaml assets
- name: Auto commit & push
# Defaults pushing to current branch (main)
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Release Partner Charts"