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

ci: add a trigger #405

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
15 changes: 9 additions & 6 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Docker

on:
pull_request:
types:
- labeled
push:
# Publish `main` as Docker `latest` image.
# branches:
Expand All @@ -17,12 +20,7 @@ jobs:
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
publish:
# Ensure test job passes before pushing image.
# needs: test

runs-on: ubuntu-latest
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v4

Expand All @@ -33,7 +31,12 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Ser the version
- name: Set the version
if: github.event_name == 'pull_request' && github.event.label.name == 'preview'
run: echo "VERSION=$(echo "${{ github.sha }}")" >> $GITHUB_ENV

- name: Set the version
if: github.event_name == 'push'
run: echo "VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV

- name: Build and push
Expand Down
Loading