ci(docker): revert workflow changes

This commit is contained in:
Matthew Penner 2023-02-23 14:35:07 -07:00
parent 8ae40a7c71
commit 0d225b0e8f
No known key found for this signature in database
2 changed files with 25 additions and 24 deletions

View file

@ -1,4 +1,4 @@
name: Container
name: Docker
on:
push:
@ -14,8 +14,8 @@ on:
- published
jobs:
build-and-push:
name: Build and Push
push:
name: Push
runs-on: ubuntu-22.04
steps:
- name: Code checkout
@ -33,8 +33,14 @@ jobs:
type=ref,event=tag
type=ref,event=branch
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: redhat-actions/podman-login@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@ -47,21 +53,14 @@ jobs:
run: |
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:1}',/" config/app.php
- name: Build
id: build
uses: redhat-actions/buildah-build@v2
- name: Build and Push
uses: docker/build-push-action@v3
with:
context: .
containerfiles: ./Containerfile
file: ./Containerfile
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
labels: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}
oci: true
- name: Push to GitHub Container Registry
uses: redhat-actions/push-to-registry@v2
if: "github.event_name != 'pull_request'"
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io
cache-from: type=gha
cache-to: type=gha,mode=max

View file

@ -1,18 +1,20 @@
# Stage 1 - Builder
FROM registry.access.redhat.com/ubi9/nodejs-18-minimal AS builder
FROM --platform=$TARGETOS/$TARGETARCH registry.access.redhat.com/ubi9/nodejs-18-minimal AS builder
USER 0
RUN npm install -g yarn
RUN npm install -g pnpm
WORKDIR /var/www/pterodactyl
COPY --chown=1001:0 public ./public
COPY --chown=1001:0 resources/scripts ./resources/scripts
COPY --chown=1001:0 .eslintignore .eslintrc.js .prettierrc.json package.json tailwind.config.js tsconfig.json vite.config.ts yarn.lock .
COPY --chown=1001:0 .eslintignore .eslintrc.js .npmrc .prettierrc.json package.json pnpm-lock.yaml tailwind.config.js tsconfig.json vite.config.ts .
RUN /opt/app-root/src/.npm-global/bin/yarn install --frozen-lockfile \
&& /opt/app-root/src/.npm-global/bin/yarn build \
&& rm -rf resources/scripts .eslintignore .eslintrc.yml .yarnrc.yml package.json tailwind.config.js tsconfig.json vite.config.ts yarn.lock node_modules
RUN /opt/app-root/src/.npm-global/bin/pnpm install \
&& /opt/app-root/src/.npm-global/bin/pnpm build \
&& rm -rf resources/scripts .eslintignore .eslintrc.yml .npmrc package.json pnpm-lock.yaml tailwind.config.js tsconfig.json vite.config.ts node_modules
USER 1001
COPY --chown=1001:0 app ./app
COPY --chown=1001:0 bootstrap ./bootstrap
@ -25,7 +27,7 @@ COPY --chown=1001:0 .env.example ./.env
COPY --chown=1001:0 artisan CHANGELOG.md composer.json composer.lock LICENSE.md README.md SECURITY.md .
# Stage 2 - Final
FROM registry.access.redhat.com/ubi9/ubi-minimal
FROM --platform=$TARGETOS/$TARGETARCH registry.access.redhat.com/ubi9/ubi-minimal
RUN microdnf update -y \
&& rpm --install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \