Skip to content
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
46 changes: 20 additions & 26 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,51 @@
name: Docker Image CI
name: Docker Image Build and Push

on:
push:
branches: [ "master" ]
# pull_request:
# branches: [ "master" ]

jobs:
# check-changed-path:
# runs-on: ubuntu-latest
# outputs:
# output1: ${{ steps.filter.outputs.filters }}
# steps:
# - uses: actions/checkout@v2
# - uses: dorny/paths-filter@v2
# id: filter
# with:
# filters: |
# 8.0:
# - '8.0/**'
# 8.1:
# - '8.1/**'

build-and-push:
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.filter.outputs.filters }}
steps:
- name: Check out source repository
uses: actions/checkout@v3
# with:
# ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
8.0:
wolukosong:
- '8.0/**'
8.1:
wolusiji:
- '8.1/**'
- name: run output
run: |
echo ${{toJSON(steps.filter.outputs.*)}}
echo "${{steps.filter.outputs.*}}"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
if: steps.filter.outputs.filters == '8.1'
- name: Build and push image php 8.0
if: steps.filter.outputs.wolukosong == 'true'
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:8.0"
platforms: linux/amd64,linux/arm64
push: true
tags: lanuma/php:8.0
- name: Build and push image php 8.1
if: steps.filter.outputs.wolusiji == 'true'
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:mysubdir"
context: "{{defaultContext}}:8.1"
platforms: linux/amd64,linux/arm64
push: true
tags: lanuma/app:latest
tags: lanuma/php:8.1,lanuma/php:latest

48 changes: 48 additions & 0 deletions .github/workflows/pull-request-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docker Image CI

on:
pull_request:
branches: [ "master" ]

jobs:
test-dockerfile-build:
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.filter.outputs.filters }}
steps:
- name: Check out source repository
uses: actions/checkout@v3
# with:
# ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
wolukosong:
- '8.0/**'
wolusiji:
- '8.1/**'
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push image php 8.0
if: steps.filter.outputs.wolukosong == 'true'
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:8.0"
platforms: linux/amd64,linux/arm64
push: false
tags: lanuma/php:8.0
- name: Build and push image php 8.1
if: steps.filter.outputs.wolusiji == 'true'
uses: docker/build-push-action@v4
with:
context: "{{defaultContext}}:8.1"
platforms: linux/amd64,linux/arm64
push: false
tags: lanuma/php:8.1,lanuma/php:latest

2 changes: 0 additions & 2 deletions 8.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini

RUN sed -i 's/memory_limit = 128M/memory_limit = 512M/g' /usr/local/etc/php/php.ini

RUN echo 'sukses 12'

WORKDIR /app

ENTRYPOINT []
Expand Down