Skip to content

Commit

Permalink
misc(ci/cd): Push to ghcr.io registry
Browse files Browse the repository at this point in the history
  • Loading branch information
xyzuan committed Nov 4, 2024
1 parent c738851 commit cf18df8
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,34 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# - name: Log in to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image
run: |
docker build \
--build-arg PORT=3121 \
--build-arg NODE_ENV=dev \
--build-arg DOMAIN=xyzuan.my.id \
--build-arg PASSWORD_PEPPER=${{ secrets.PASSWORD_PEPPER }} \
--build-arg DATABASE_URL=${{ secrets.DATABASE_URL }} \
--build-arg DATABASE_URL=${{ secrets.DATABASE_URL_DEV }} \
--build-arg GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} \
--build-arg GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }} \
--build-arg GITHUB_CLIENT_ID=${{ secrets.GITHUB_CLIENT_ID }} \
--build-arg GITHUB_CLIENT_SECRET=${{ secrets.GITHUB_CLIENT_SECRET }} \
--build-arg GITHUB_CLIENT_ID=${{ secrets.GH_CLIENT_ID }} \
--build-arg GITHUB_CLIENT_SECRET=${{ secrets.GH_CLIENT_SECRET }} \
--build-arg LINKEDIN_CLIENT_ID=${{ secrets.LINKEDIN_CLIENT_ID }} \
--build-arg LINKEDIN_CLIENT_SECRET=${{ secrets.LINKEDIN_CLIENT_SECRET }} \
--build-arg TELEGRAM_TOKEN=${{ secrets.TELEGRAM_TOKEN }} \
--build-arg TELEGRAM_CHAT_ID=${{ secrets.TELEGRAM_CHAT_ID }} \
--build-arg CLOUDINARY_CLOUD_NAME=${{ secrets.CLOUDINARY_CLOUD_NAME }} \
--build-arg CLOUDINARY_API_KEY=${{ secrets.CLOUDINARY_API_KEY }} \
--build-arg CLOUDINARY_API_SECRET=${{ secrets.CLOUDINARY_API_SECRET }} \
-t xyzuan_be:latest -f misc/Dockerfile.dev .
-t ghcr.io/xyzuan/xyzuan_be:latest -f misc/Dockerfile.dev .
- name: Tag Docker image
run: |
IMAGE_NAME=xyzuan_be
IMAGE_NAME=ghcr.io/xyzuan/xyzuan_be
GIT_SHA=$(echo "${{ github.sha }}" | head -c 7)
docker tag $IMAGE_NAME:latest $IMAGE_NAME:$GIT_SHA
# - name: Push Docker image
# run: |
# IMAGE_NAME=xyzuan_be
# GIT_SHA=$(echo "${{ github.sha }}" | head -c 7)
# docker push $IMAGE_NAME:latest
# docker push $IMAGE_NAME:$GIT_SHA
- name: Push Docker image
run: |
docker login --username xyzuan --password ${{ secrets.GH_TOKEN }} ghcr.io
docker push ghcr.io/xyzuan/xyzuan_be

0 comments on commit cf18df8

Please sign in to comment.