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

View file

@ -1,18 +1,20 @@
# Stage 1 - Builder # 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 USER 0
RUN npm install -g yarn RUN npm install -g pnpm
WORKDIR /var/www/pterodactyl WORKDIR /var/www/pterodactyl
COPY --chown=1001:0 public ./public COPY --chown=1001:0 public ./public
COPY --chown=1001:0 resources/scripts ./resources/scripts 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 \ RUN /opt/app-root/src/.npm-global/bin/pnpm install \
&& /opt/app-root/src/.npm-global/bin/yarn build \ && /opt/app-root/src/.npm-global/bin/pnpm build \
&& rm -rf resources/scripts .eslintignore .eslintrc.yml .yarnrc.yml package.json tailwind.config.js tsconfig.json vite.config.ts yarn.lock node_modules && 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 app ./app
COPY --chown=1001:0 bootstrap ./bootstrap 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 . COPY --chown=1001:0 artisan CHANGELOG.md composer.json composer.lock LICENSE.md README.md SECURITY.md .
# Stage 2 - Final # 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 \ RUN microdnf update -y \
&& rpm --install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ && rpm --install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \