Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Version release with edge only on master branch #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions .github/workflows/delivery.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Delivery

on:
on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [ master ]
branches: [master]
release:
# Note: a current limitation is that when a release is edited after publication, then the Docker tags are not automatically updated.
types: [ published ]
# Make it possible to trigger the checks manually.
workflow_dispatch:
types: [published]
schedule:
# Run every monday on 9:00 in the morning (UTC).
- cron: '0 9 * * 1'

permissions:
contents: write
Expand All @@ -20,24 +23,34 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Check whether this event is the HEAD of main
continue-on-error: true
id: is-head-main
run: git rev-parse HEAD | grep -x ${{ github.sha }}
shell: bash

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=raw,value=edge
type=edge,enable=${{ steps.is-head-main.outcome == 'success' }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build container and push to GitHub Container Registry
uses: docker/build-push-action@v5
if: ${{ github.event_name == 'release' || github.event_name == 'push' }}
with:
context: .
push: true
Expand Down
Loading