new s6 #113
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- '8.1' | |
- '8.1-fpm' | |
- '8.1-full' | |
- '8.1-debug' | |
- '8.1-full-nginx' | |
- '7.4' | |
- '7.4-fpm' | |
- '7.4-full' | |
- '7.4-debug' | |
- '7.4-full-nginx' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test Ruby Version | |
run: ruby -v | |
- id: install_puppet | |
name: Install Puppet | |
continue-on-error: true | |
run: | | |
sudo apt-get -qqy install git sudo ruby | |
sudo gem install puppet -v 7.27.0 --no-document | |
sudo rm -fR /etc/puppetlabs/code/modules/image_build | |
sudo git clone --single-branch --branch v2 https://github.com/luckyraul/puppetlabs-image_build.git /etc/puppetlabs/code/modules/image_build | |
- name: Test Puppet Version | |
run: puppet -V | |
- name: Build Image | |
run: sudo puppet docker build --image-name mygento/php:${{ matrix.version }} --no-show-diff | |
- name: Test Image Version | |
run: docker run --rm mygento/php:${{ matrix.version }} php -v | |
- name: Test Image Modules | |
run: docker run --rm mygento/php:${{ matrix.version }} php -m | |
- name: Test Image Config | |
run: docker run --rm mygento/php:${{ matrix.version }} php -i | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Push image | |
run: | | |
export IMAGE_NAME=mygento/php:${{ matrix.version }} | |
export IMAGE_ID=ghcr.io/luckyraul/php:${{ matrix.version }} | |
# Change all uppercase to lowercase | |
export IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
echo $IMAGE_ID | |
docker tag $IMAGE_NAME $IMAGE_ID | |
docker push $IMAGE_ID | |
- name: Push image Mygento | |
run: | | |
export IMAGE_NAME=mygento/php:${{ matrix.version }} | |
export IMAGE_ID=ghcr.io/mygento/php:${{ matrix.version }} | |
# Change all uppercase to lowercase | |
export IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
echo $IMAGE_ID | |
docker tag $IMAGE_NAME $IMAGE_ID | |
docker push $IMAGE_ID | |
post_build: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete untagged ghcr LR | |
uses: Chizkiyahu/delete-untagged-ghcr-action@v2 | |
with: | |
token: ${{ secrets.CR_PAT }} | |
repository_owner: ${{ github.repository_owner }} | |
owner_type: user | |
package_name: php | |
- name: Delete untagged ghcr Mygento | |
uses: Chizkiyahu/delete-untagged-ghcr-action@v2 | |
with: | |
token: ${{ secrets.CR_PAT }} | |
repository_owner: mygento | |
owner_type: org | |
package_name: php |