-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update actions and related stuff (#21)
Signed-off-by: Artem Bortnikov <[email protected]>
- Loading branch information
Showing
10 changed files
with
265 additions
and
59 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: "docker" | ||
directory: "/.docker/lifecycle-controller-manager" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: "docker" | ||
directory: "/.docker/lifecycle-service" | ||
schedule: | ||
interval: "daily" | ||
open-pull-requests-limit: 10 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Dependabot auto-approve | ||
|
||
on: pull_request | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} | ||
steps: | ||
- name: Dependabot metadata | ||
id: dependabot-metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
- uses: actions/checkout@v4 | ||
- name: Setup gh cli | ||
uses: ksivamuthu/actions-setup-gh-cli@v2 | ||
- name: Approve a Dependabot PR | ||
run: gh pr review --approve "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- name: Enable auto-merge for Dependabot PRs | ||
run: gh pr merge --auto --squash "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
name: Main commit workflow | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- 'docs/**' | ||
- '**/*.md' | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
|
||
env: | ||
platforms: linux/amd64,linux/arm64 | ||
registry: ghcr.io | ||
|
||
jobs: | ||
go-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Setup golang | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Lint golang sources | ||
uses: golangci/golangci-lint-action@v4 | ||
with: | ||
args: -e S1008 --timeout 15m | ||
|
||
go-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Setup golang | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Run tests | ||
run: make test | ||
|
||
docker-build-controller-manager: | ||
needs: [ go-lint, go-test ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Login to Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.registry }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get metadata for docker | ||
uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: | | ||
ghcr.io/${{ github.repository_owner }}/lifecycle-controller-manager | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=sha | ||
flavor: | | ||
latest=${{ github.ref == 'refs/heads/main' }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
image: tonistiigi/binfmt:latest | ||
platforms: ${{env.platforms}} | ||
|
||
- name: Set up Docker Context for Buildx | ||
id: buildx-context | ||
run: | | ||
docker context create builders | ||
- name: Set up Docker Buildx | ||
timeout-minutes: 5 | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
version: latest | ||
endpoint: builders | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
timeout-minutes: 60 | ||
with: | ||
file: .docker/lifecycle-controller-manager/Dockerfile | ||
context: . | ||
platforms: ${{ env.platforms }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
docker-build-lifecycle-service: | ||
needs: [ go-lint, go-test ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Login to Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.registry }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get metadata for docker | ||
uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: | | ||
ghcr.io/${{ github.repository_owner }}/lifecycle-service | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=sha | ||
flavor: | | ||
latest=${{ github.ref == 'refs/heads/main' }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
image: tonistiigi/binfmt:latest | ||
platforms: ${{env.platforms}} | ||
|
||
- name: Set up Docker Context for Buildx | ||
id: buildx-context | ||
run: | | ||
docker context create builders | ||
- name: Set up Docker Buildx | ||
timeout-minutes: 5 | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
version: latest | ||
endpoint: builders | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
timeout-minutes: 60 | ||
with: | ||
file: .docker/lifecycle-service/Dockerfile | ||
context: . | ||
platforms: ${{ env.platforms }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [ opened, reopened, synchronize ] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update_release_draft: | ||
permissions: | ||
# write permission is required to create a github release | ||
contents: write | ||
# write permission is required for autolabeler | ||
# otherwise, read permission is required at least | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "main" | ||
- uses: release-drafter/release-drafter@v5 | ||
- uses: release-drafter/release-drafter@v6 | ||
with: | ||
disable-releaser: github.ref != 'refs/heads/main' | ||
config-name: release-drafter.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Assign size labels to PRs' | ||
|
||
on: [workflow_dispatch, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
size-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: size-label | ||
uses: pascalgn/[email protected] | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file was deleted.
Oops, something went wrong.
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