Skip to content

Commit

Permalink
chore: run releases on separate release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Dec 22, 2023
1 parent 7f9d997 commit ccd4d7e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ name: Deploy updated templates

env:
GO_VERSION: ^1.21
BRANCH: release

on:
push:
branches: [master]
paths: ["templates/**"]
branches:
- "{{ $env.BRANCH }}"
paths:
- templates/**
workflow_dispatch:

jobs:
Expand All @@ -16,6 +19,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/{{ $env.BRANCH }}

- uses: actions/setup-go@v4
with:
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Nightly Build

env:
GO_VERSION: ^1.21
BRANCH: master

on:
schedule: # runs on the default branch: master
Expand All @@ -16,6 +17,10 @@ jobs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/{{ $env.BRANCH }}
fetch-depth: 0

- name: print latest_commit
run: echo ${{ github.sha }}

Expand All @@ -30,9 +35,9 @@ jobs:
needs: check_date
if: |
${{ needs.check_date.outputs.should_run != 'false' }}
&& startsWith(github.ref, 'refs/heads/master')
&& startsWith(github.ref, 'refs/heads/{{ $env.BRANCH }}')
&& ! contains(github.head_ref, 'refs/heads/chore/')
uses: evcc-io/evcc/.github/workflows/default.yml@master
uses: evcc-io/evcc/.github/workflows/default.yml@{{ $env.BRANCH }}

docker:
name: Publish Docker :nightly
Expand All @@ -43,7 +48,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/master # force master
ref: refs/heads/{{ $env.BRANCH }}
fetch-depth: 0

- name: Get dist from cache
Expand Down Expand Up @@ -80,6 +85,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/{{ $env.BRANCH }}
fetch-depth: 0

- uses: actions/setup-go@v4
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Release

env:
GO_VERSION: ^1.21
BRANCH: release

on:
push:
Expand All @@ -11,7 +12,7 @@ on:
jobs:
call-build-workflow:
if: startsWith(github.ref, 'refs/tags')
uses: evcc-io/evcc/.github/workflows/default.yml@master
uses: evcc-io/evcc/.github/workflows/default.yml@{{ $env.BRANCH }}

docker:
name: Publish Docker :release
Expand All @@ -22,6 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/{{ $env.BRANCH }}
fetch-depth: 0

- name: Login
Expand Down Expand Up @@ -58,6 +60,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/{{ $env.BRANCH }}
fetch-depth: 0

- name: Setup Go
Expand Down Expand Up @@ -116,6 +119,10 @@ jobs:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/{{ $env.BRANCH }}
fetch-depth: 0

- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --local-only --config packaging/fly.toml

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ name: Deploy data to website

env:
GO_VERSION: ^1.21
BRANCH: release

on:
push:
branches: [master]
paths: ["templates/evcc.io/**"]
branches:
- "{{ $env.BRANCH }}"
paths:
- templates/evcc.io/**
workflow_dispatch:

jobs:
Expand All @@ -16,6 +19,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: refs/heads/{{ $env.BRANCH }}

- uses: actions/setup-go@v4
with:
Expand Down

0 comments on commit ccd4d7e

Please sign in to comment.