Skip to content

Merge pull request #6 from krystal/release-please--branches--master #18

Merge pull request #6 from krystal/release-please--branches--master

Merge pull request #6 from krystal/release-please--branches--master #18

Workflow file for this run

---
name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
push: false
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
release-please:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }} # e.g. v1.0.0
version: ${{ steps.release-please.outputs.version }} # e.g. 1.0.0
steps:
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
command: manifest
config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
- name: Create/update MAJOR tag
if: ${{ steps.release-please.outputs.release_created }}
uses: richardsimko/update-tag@v1
with:
tag_name: v${{ steps.release-please.outputs.major }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create/update MAJOR.MINOR tag
if: ${{ steps.release-please.outputs.release_created }}
uses: richardsimko/update-tag@v1
with:
tag_name: v${{ steps.release-please.outputs.major }}.${{ steps.release-please.outputs.minor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-latest:
runs-on: ubuntu-latest
needs: [build]
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/${{ github.repository }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
release:
runs-on: ubuntu-latest
needs: [release-please, build]
if: needs.release-please.outputs.release_created
steps:
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ needs.release-please.outputs.version }}
ghcr.io/${{ github.repository }}:stable
cache-from: type=gha
cache-to: type=gha,mode=max