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: github actions updates #124

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
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
37 changes: 37 additions & 0 deletions .github/workflows/build-pr-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Artifacts for PRs

on:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
generate-tag:
name: Generate docker tag
runs-on: ubuntu-latest
outputs:
image_tag: ${{steps.gen_tag_names.outputs.tag_name}}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 1

# Replace problematic characters in branch name (like '/') with safe characters (like '.')
- name: Generate Tag Names
id: gen_tag_names
run: |
tag_name=$(echo ${{ github.head_ref }} | tr "/" .)
echo "Tag Name: $tag_name"
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
build:
name: Build Shopify Tracker Docker Image
uses: ./.github/workflows/build-and-push-docker-image.yml
needs: [generate-tag]
with:
img_tag: ${{ needs.generate-tag.outputs.image_tag }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

# Only allow release stakeholders to initiate releases
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'utsabc' || github.actor == 'shrouti1507') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'utsabc' || github.triggering_actor == 'shrouti1507')
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')) && (github.actor == 'ItsSudip' || github.actor == 'krishna2020' || github.actor == 'utsabc' || github.actor == 'shrouti1507') && (github.triggering_actor == 'ItsSudip' || github.triggering_actor == 'krishna2020' || github.triggering_actor == 'utsabc' || github.triggering_actor == 'shrouti1507' || github.triggering_actor == 'sanpj2292')
steps:
- name: Checkout
uses: actions/checkout@v4.1.0
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY package*.json ./
COPY . .
RUN rm -rf /usr/src/app/node_modules

RUN npm install --only=prod
RUN npm ci --no-audit --cache .npm
# If you are building your code for production
# RUN npm ci --only=production

Expand Down
Loading