Skip to content

Commit

Permalink
Hamster Left A Pull Request - (Update deploy.yml) (#228)
Browse files Browse the repository at this point in the history
* Update deploy.yml

* CI Upgrades.

* Update mirror.yml

---------

Co-authored-by: Vedansh <[email protected]>
  • Loading branch information
TheHamsterBot and offensive-vk authored Sep 19, 2024
1 parent e2b2c96 commit eb029e9
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN apt-get update && \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN npm i -g pnpm
RUN npm i -g pnpm@9.0.0
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --frozen-lockfile
Expand All @@ -29,4 +29,4 @@ COPY . .
RUN chown -R user:user /usr/src/app
USER user
EXPOSE 7777
CMD ["npm", "run", "start"]
CMD ["pnpm", "run", "start"]
26 changes: 23 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"
interval: weekly
groups:
actions-minor:
update-types:
- minor
- patch

- package-ecosystem: npm
directory: /
schedule:
interval: weekly
groups:
npm-development:
dependency-type: development
update-types:
- minor
- patch
npm-production:
dependency-type: production
update-types:
- patch
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
node-version: [18.x, 19.x, 20.x, 21.x, 22.x]

name: Linux - Build & Test on Node Version ${{ matrix.node-version }}
name: Linux - Build & Test on v${{ matrix.node-version }}
steps:
- uses: actions/checkout@v4

Expand All @@ -44,7 +44,7 @@ jobs:
matrix:
node-version: [18.x, 19.x, 20.x, 21.x, 22.x]

name: Macos - Build & Test on Node Version ${{ matrix.node-version }}
name: Macos - Build & Test on v${{ matrix.node-version }}
steps:
- uses: actions/checkout@v4

Expand All @@ -67,7 +67,7 @@ jobs:
matrix:
node-version: [18.x, 19.x, 20.x, 21.x, 22.x]

name: Windows - Build & Test on Node Version ${{ matrix.node-version }}
name: Windows - Build & Test on v${{ matrix.node-version }}
steps:
- uses: actions/checkout@v4

Expand Down
33 changes: 21 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
name: CI / Deploy to GHCR

on:
schedule:
- cron: '0 0 * * 0'
push:
tags:
- '*'
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:

env:
USERNAME: ${{ github.repository_owner }}
REGISTRY: ghcr.io
USER: ${{ github.repository_owner }}
IMAGE_NAME: ${{ github.repository }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
PASSPRHASE: ${{ secrets.GITHUB_TOKEN || secrets.BOT_TOKEN }}

jobs:
build-and-push-image:
runs-on: macos-latest
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
packages: write
Expand All @@ -24,21 +26,28 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Log in to the Container Registry
- name: Login to the Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSPRHASE }}

- name: Extract Metadata (tags, labels) for Docker
- name: Extract Metadatafor Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v3
- name: Verify Tags and Labels
run: |
echo "## Github Action Summary - Docker CI " >> $GITHUB_STEP_SUMMARY
echo "Tags: ${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo "Labels: ${{ steps.meta.outputs.labels }} " >> $GITHUB_STEP_SUMMARY
echo "*** VERIFICATION COMPLETED ***" >> $GITHUB_STEP_SUMMARY
- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: .
push: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
schedule:
- cron: '0 */1 * * *'
push:
branches: [ "master", "*" ]
branches: [ "master", "**" ]
pull_request:
branches: [ "master", "*" ]
branches: [ "master", "**" ]
workflow_dispatch:

jobs:
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
env:
REGISTRY: docker.io
IMAGE_NAME: ${{ secrets.DOCKER_USER }}/${{ secrets.DOCKER_IMAGE }}

USERNAME: ${{ secrets.DOCKER_USER }}
PASSWORD: ${{ secrets.DOCKER_TOKEN }}
jobs:
push:
runs-on: ubuntu-latest
Expand All @@ -29,20 +30,27 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Log into registry ${{ env.REGISTRY }}
- name: Login to Registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Verify Tags and Labels
run: |
echo "## Github Action Summary - Docker CI " >> $GITHUB_STEP_SUMMARY
echo "Tags: ${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo "Labels: ${{ steps.meta.outputs.labels }} " >> $GITHUB_STEP_SUMMARY
echo "*** VERIFICATION COMPLETED ***" >> $GITHUB_STEP_SUMMARY
- name: Build and Push Docker Image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
Expand All @@ -59,4 +67,4 @@ jobs:
env:
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
run: echo "Image with ${TAGS} tag has been sucessfully Signed."
run: echo "Image with ${TAGS} tag has been sucessfully Signed."
2 changes: 1 addition & 1 deletion .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
timeout-minutes: 10
name: Gitlab Repo Sync
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wangchucheng/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
## This Pull Request Was Automated by [Hamster [bot]](https://github.com/TheHamsterBot)
> [!NOTE]
> Workflow Trigger: ${{ github.event_name }} event at ${{ github.action_ref }} .
> Workflow Trigger: ${{ github.event_name }} event ${{ github.action_ref }} .
> Details of Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- Author: @TheHamsterBot
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN pnpm run install
COPY --chown=node:node . .

# Build TypeScript files using tsup (for bundling)
RUN npm run build
RUN pnpm run build

# Set proper file ownership and permissions
RUN chown -R node:node /usr/src/app
Expand All @@ -40,6 +40,6 @@ USER node
EXPOSE ${PORT}

# Command to start the application
CMD ["npm","start"]
CMD ["pnpm","start"]

# syntax=docker/dockerfile:END

0 comments on commit eb029e9

Please sign in to comment.