Skip to content

Commit

Permalink
Update workflow to build PR's when tagged with 'build' label
Browse files Browse the repository at this point in the history
  • Loading branch information
MonicaG committed Nov 20, 2023
1 parent 23623f3 commit 8ac8c5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: On Push To Main Actions
name: Build and Deploy

env:
REGISTRY: ghcr.io
Expand All @@ -14,9 +14,14 @@ on:
- '.github/**'
- 'README.md'
branches: [ "main" ]
pull_request:
types: [opened, synchronize, reopened, labeled]
branches: [ "main" ]


jobs:
build:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'build'))
runs-on: ubuntu-latest

steps:
Expand All @@ -38,7 +43,9 @@ jobs:
# Always generate latest tag (https://github.com/docker/metadata-action#latest-tag)
flavor: latest=true
# Sha tag is used in udpate_deploy_file job below
tags: type=sha
tags: |
type=sha
type=ref,event=pr
- name: Login to GHCR
uses: docker/login-action@v2
with:
Expand Down Expand Up @@ -66,6 +73,7 @@ jobs:
cache-to: type=gha,mode=max

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

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ site
# vscode workspace
*.code-workspace
.vscode/*
.swc/

0 comments on commit 8ac8c5d

Please sign in to comment.