Skip to content

Commit

Permalink
ci(workflow): using the alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
arhamj committed Oct 23, 2024
1 parent 12fbf4c commit 4f245e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,19 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Declare version variables
shell: bash
- name: Get short commit hash and determine branch name
id: set-env-vars
run: |
echo "SHORT_COMMIT_HASH=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
# Get short commit hash
echo "Branch: $(git rev-parse --short HEAD)"
echo "SHORT_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# Determine branch name
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV # Source branch of the PR
else
echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV # Actual branch name for push events
fi
- name: Echo step
run: |
echo "Branch: ${{ env.SHORT_COMMIT_HASH }}"
Expand Down
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# syntax=docker/dockerfile:1

## global args
ARG NODE_VERSION=18.16.1

FROM node:${NODE_VERSION}
SHELL [ "/bin/bash", "-cex" ]
FROM node:18.16.1-alpine
SHELL [ "/bin/sh", "-cex" ]

# Create app directory
WORKDIR /usr/src/app
Expand Down

0 comments on commit 4f245e5

Please sign in to comment.