Skip to content

Commit 7306608

Browse files
authored
Merge pull request #16 from wayofdev/feat/refactor
2 parents c5cf090 + cb4f01e commit 7306608

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+712
-1386
lines changed

.ansible-lint

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
3+
# https://ansible-lint.readthedocs.io/en/latest/configuring/
4+
5+
skip_list:
6+
- experimental
7+
8+
exclude_paths:
9+
- ./contrib
10+
- ./.venv
11+
12+
...

.github/dependabot.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/labeler.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
3+
# this file is for the labeler workflow job
4+
# Documentation https://github.com/marketplace/actions/labeler
5+
6+
"type: documentation":
7+
- assets/**/*
8+
- .github/*
9+
- ./*.md
10+
11+
"type: maintenance":
12+
- .github/workflows/*
13+
14+
...

.github/workflows/apply-labels.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
3+
# This workflow will triage pull requests and apply a label based on the
4+
# paths that are modified in the pull request.
5+
#
6+
# To use this workflow, you will need to set up a .github/labeler.yml
7+
# file with configuration. For more information, see:
8+
# https://github.com/actions/labeler/blob/master/README.md
9+
10+
on: # yamllint disable-line rule:truthy
11+
pull_request:
12+
13+
name: 🏷️ Add labels
14+
15+
jobs:
16+
label:
17+
uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master
18+
with:
19+
os: ubuntu-latest
20+
secrets:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
...
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
3+
# https://github.com/peter-evans/enable-pull-request-automerge
4+
5+
on: # yamllint disable-line rule:truthy
6+
pull_request:
7+
8+
permissions:
9+
pull-requests: write
10+
contents: write
11+
12+
name: 🤞 Auto merge release
13+
14+
jobs:
15+
auto-merge:
16+
uses: wayofdev/gh-actions/.github/workflows/auto-merge-release.yml@master
17+
with:
18+
os: ubuntu-latest
19+
pull-request-number: ${{ github.event.pull_request.number }}
20+
actor: lotyp
21+
merge-method: merge
22+
secrets:
23+
# to trigger other workflows, pass PAT token instead of GITHUB_TOKEN
24+
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
25+
26+
...

.github/workflows/build-latest.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
3+
on: # yamllint disable-line rule:truthy
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
12+
name: 🚀 Build docker images with latest tag
13+
14+
jobs:
15+
build:
16+
runs-on: "ubuntu-latest"
17+
strategy:
18+
fail-fast: true
19+
matrix:
20+
os_name: ["alpine"]
21+
php_version: ["8.1", "8.2"]
22+
php_type: ["fpm", "cli", "supervisord"]
23+
environment:
24+
name: latest
25+
url: https://hub.docker.com/r/wayofdev/php-base/tags?page=1&name=latest
26+
27+
steps:
28+
- name: 📦 Check out the codebase
29+
uses: actions/checkout@v3
30+
31+
- name: 🛠️ Install goss and dgoss
32+
uses: e1himself/[email protected]
33+
34+
- name: 🌎 Set environment variables
35+
env:
36+
IMAGE_NAMESPACE: wayofdev/php-base
37+
IMAGE_TEMPLATE: ${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}
38+
IMAGE_TAG: wayofdev/php-base:${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}-latest
39+
run: |
40+
echo "IMAGE_NAMESPACE=${IMAGE_NAMESPACE}" >> $GITHUB_ENV
41+
echo "IMAGE_TEMPLATE=${IMAGE_TEMPLATE}" >> $GITHUB_ENV
42+
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
43+
44+
- name: 🤖 Generate dist files
45+
run: make generate
46+
47+
- name: 🐳 Extract docker meta data
48+
id: meta
49+
uses: docker/metadata-action@v4
50+
with:
51+
images: ${{ env.IMAGE_NAMESPACE }}
52+
tags: |
53+
type=raw,event=branch,value=latest
54+
type=ref,event=pr
55+
type=semver,pattern={{version}}
56+
type=semver,pattern={{major}}.{{minor}}
57+
flavor: |
58+
latest=false
59+
prefix=${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}-
60+
61+
- name: 🔑 Login to docker-hub
62+
if: github.event_name != 'pull_request'
63+
uses: docker/login-action@v2
64+
with:
65+
username: ${{ secrets.DOCKER_USERNAME }}
66+
password: ${{ secrets.DOCKER_TOKEN }}
67+
68+
- name: 🖥️ Setup QEMU
69+
uses: docker/setup-qemu-action@v2
70+
with:
71+
platforms: arm64
72+
73+
- name: 🛠️ Setup Docker Buildx
74+
uses: docker/setup-buildx-action@v2
75+
with:
76+
install: true
77+
78+
- name: 🚀 Build and Export to Docker
79+
uses: docker/build-push-action@v3
80+
with:
81+
context: ./dist/base/${{ env.IMAGE_TEMPLATE }}
82+
load: true
83+
tags: ${{ steps.meta.outputs.tags }}
84+
cache-from: type=gha
85+
cache-to: type=gha,mode=max
86+
labels: ${{ steps.meta.outputs.labels }}
87+
88+
- name: 🧪 Test Docker image with "latest" tag
89+
run: IMAGE_TAG=${{ env.IMAGE_TAG }} make test
90+
91+
- name: 📤 Push Docker image
92+
uses: docker/build-push-action@v3
93+
with:
94+
context: ./dist/base/${{ env.IMAGE_TEMPLATE }}
95+
platforms: linux/amd64,linux/arm64
96+
push: ${{ github.event_name != 'pull_request' }}
97+
tags: ${{ steps.meta.outputs.tags }}
98+
cache-from: type=gha
99+
cache-to: type=gha,mode=max
100+
101+
...

.github/workflows/ci.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.

.github/workflows/create-release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
3+
# https://github.com/wayofdev/gh-actions/blob/master/.github/workflows/create-release.yml
4+
# https://github.com/google-github-actions/release-please-action#release-types-supported
5+
6+
on: # yamllint disable-line rule:truthy
7+
push:
8+
branches:
9+
- master
10+
11+
name: 📦 Create release
12+
13+
jobs:
14+
release:
15+
uses: wayofdev/gh-actions/.github/workflows/create-release.yml@master
16+
with:
17+
os: ubuntu-latest
18+
branch: master
19+
package-name: docker-php-base
20+
secrets:
21+
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
22+
23+
...

.github/workflows/release-please.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)