mirror of
https://github.com/MuXiu1997/traefik-github-oauth-plugin
synced 2025-12-17 18:31:27 +00:00
ci: update GitHub workflows
This commit is contained in:
16
.github/workflows/release-please.yml
vendored
16
.github/workflows/release-please.yml
vendored
@@ -1,16 +0,0 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
name: release-please
|
||||
jobs:
|
||||
release-please:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: google-github-actions/release-please-action@v3
|
||||
with:
|
||||
release-type: go
|
||||
package-name: traefik-github-oauth-plugin
|
||||
82
.github/workflows/release.yml
vendored
Normal file
82
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Release
|
||||
id: release
|
||||
uses: google-github-actions/release-please-action@v3
|
||||
with:
|
||||
release-type: go
|
||||
package-name: traefik-github-oauth-plugin
|
||||
|
||||
- name: Setup Go
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.19
|
||||
|
||||
- name: Checkout
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ steps.release.outputs.tag_name }}
|
||||
|
||||
- name: Build
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
run: make
|
||||
|
||||
- name: Upload Release Assets
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: gh release upload ${{ steps.release.outputs.tag_name }} dist/*
|
||||
|
||||
# region Docker
|
||||
- name: Set up Docker Buildx
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build And Push Docker Images
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
muxiu1997/traefik-github-oauth-server:${{ steps.release.outputs.tag_name }}
|
||||
muxiu1997/traefik-github-oauth-server:latest
|
||||
|
||||
- name: Replace The Relative Path In The README.md
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
run: |
|
||||
sed -E 's#(\[[^]]*\])\(\.\/([^)]+)\)#\1(https://github.com/${{ github.repository }}/raw/${{ steps.release.outputs.tag_name }}/\2)#g' README.md > docker.README.md
|
||||
|
||||
- name: Update Docker Images Description
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
uses: peter-evans/dockerhub-description@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
repository: muxiu1997/traefik-github-oauth-server
|
||||
short-description: server for traefik-github-oauth-plugin
|
||||
readme-filepath: docker.README.md
|
||||
# endregion Docker
|
||||
Reference in New Issue
Block a user