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

build: always build dockerfile but skip pushing if PR #368

Merged
merged 3 commits into from
Dec 10, 2023
Merged
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
22 changes: 11 additions & 11 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ jobs:
fetch-depth: 1
repository: 'openbeta/api-server-deployment'
token: ${{ secrets.GH_DEPLOYMENT_REPO_TOKEN }}
ref: main
- uses: imranismail/setup-kustomize@v2
- run: |
kustomize edit set image vnguyen/openbeta-graph-api:sha-${GITHUB_SHA}
- name: Check if there are changes
id: changes
uses: UnicornGlobal/[email protected]
- name: Check if there is any change
id: get_changes
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Push if tag has changes
if: steps.changes.outputs.changed == 1
if: steps.get_changes.outputs.changed != 0
run: |
cd api-server-deployment/stage
git config user.name github-actions
Expand All @@ -50,14 +51,15 @@ jobs:
fetch-depth: 1
repository: 'openbeta/api-server-deployment'
token: ${{ secrets.GH_DEPLOYMENT_REPO_TOKEN }}
ref: main
- uses: imranismail/setup-kustomize@v2
- run: |
kustomize edit set image vnguyen/openbeta-graph-api:${GITHUB_REF}
- name: Check if there are changes
id: changes
uses: UnicornGlobal/[email protected]
- name: Check if there is any change
id: get_changes
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Push if tag has changes
if: steps.changes.outputs.changed == 1
if: steps.get_changes.outputs.changed != 0
run: |
git config user.name github-actions
git config user.email [email protected]
Expand All @@ -67,7 +69,6 @@ jobs:
# build docker image and push to registry
docker:
runs-on: ubuntu-22.04
if: github.event_name != 'pull_request'
needs: test
steps:
- name: 'Checkout Project'
Expand All @@ -93,7 +94,6 @@ jobs:
tags: |
type=ref,event=branch
type=semver,pattern={{raw}}
type=ref,event=pr
type=sha,format=long

- name: Build docker image
Expand All @@ -102,7 +102,7 @@ jobs:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}

# setup basic machine to run all kinds of tests: lint, unit, integration, types
Expand Down
Loading