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

Revert to backwards #138

Merged
merged 1 commit into from
May 10, 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
77 changes: 51 additions & 26 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,68 @@
name: CI / Docker Publish Image

on:
workflow_dispatch:
schedule:
- cron: '10 0 * * *'
push:
branches:
- master
branches: [ "master"]
workflow_dispatch:

env:
IMAGE_NAME: untileverything
DOCKER_USER: ntsystems
GHCR_REGISTRY: ghcr.io
DOCKERHUB_REGISTRY: docker.io
REGISTRY: docker.io
IMAGE_NAME: ntsystems/untileverything

jobs:
docker:
push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3

- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
with:
cosign-release: 'v2.1.1'

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0


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

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

- name: Build and Push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64/v8,windows/amd64,windows/arm64,macos/amd64,macos/arm64
tags: |
latest
latest
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "Image with ${TAGS} tag has been sucessfully Signed."
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1

ARG NODE_VERSION=20
FROM node:20
FROM node:${NODE_VERSION}-alpine
LABEL maintainer "Vedansh Khandelwal <https://github.com/offensive-vk/>"
LABEL org.opencontainers.image.source "https://github.com/offensive-vk/UntilEverything"
LABEL org.opencontainers.image.source https://github.com/offensive-vk/UntilEverything
ENV NODE_ENV production
WORKDIR /usr/src/app
RUN --mount=type=bind,source=package.json,target=package.json \
Expand All @@ -13,4 +14,4 @@ USER node
COPY . .
EXPOSE 9999
CMD ["npm", "start"]
# syntax=docker/dockerfile:END
# syntax=docker/dockerfile:END
Loading