Skip to content

Commit

Permalink
fix(ci): use 'build' label
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampouille committed Oct 18, 2024
1 parent 61b67ec commit e843e48
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,17 @@ jobs:
build-on-pr:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 120

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check if "build" label is present
id: label-check
uses: actions-ecosystem/action-get-labeled@v1
with:
label: 'build'
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
if: steps.label-check.outputs.labeled == 'true'
if: ${{ github.event.label.name == 'build' }}
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build and push to ghcr
if: steps.label-check.outputs.labeled == 'true'
if: ${{ github.event.label.name == 'build' }}
run: |
TAG="pr-${{ github.event.pull_request.number }}-$(git rev-parse --short HEAD)"
docker build -t ghcr.io/camptocamp/pg253:${TAG} \
Expand All @@ -66,6 +59,6 @@ jobs:
docker push ghcr.io/camptocamp/pg253:${TAG}
- name: Build only
if: steps.label-check.outputs.labeled != 'true'
if: ${{ github.event.label.name != 'build' }}
run: |
docker build --pull --no-cache .

0 comments on commit e843e48

Please sign in to comment.