Wordpress #23
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: Wordpress | |
on: | |
schedule: | |
- cron: '00 02 * * *' | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
Wordpress-AMD64: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the Docker image wordpress latest | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
MARIADB_VERSION: 10.7 | |
APP_CODE_PATH_HOST: /tmp/wordpress | |
DB_NAME: test | |
DB_USER: admin | |
DB_PASSWORD: password | |
DB_ROOT_PASSWORD: password | |
DATA_PATH_HOST: /tmp/db | |
USER_ID: "0" | |
GROUP_ID: "0" | |
- name: PHP version check | |
run : docker exec wordpress_wordpress_1 php -v | |
- name: Mysql Driver check | |
run: docker exec wordpress_wordpress_1 php -m | grep mysqli | |
- name: Wordpress CLI check | |
run: docker exec wordpress_wordpress_1 wp --info | grep WP-CLI | |
- name: Web site Test | |
run: | | |
sleep 50s | |
sudo curl -I --http2 http://localhost:44181/wp-admin/install.php | |
- name: Verify MariaDB running from host, create Database and show Database | |
run: | | |
while ! docker exec wordpress_mysql_1 mysqladmin --user=root --password=password --host "mysql" ping --silent &> /dev/null ; do | |
echo "Waiting for database connection..." | |
sleep 2 | |
done | |
- name: Check MariaDB version | |
run: docker exec wordpress_mysql_1 mysql -uroot -ppassword -e "SHOW VARIABLES LIKE '%version%';" | |
- name: Verify MariaDB database from user | |
run: docker exec wordpress_mysql_1 mysql -uadmin -ppassword -e "SHOW DATABASES" | |
- name: Create a Database | |
run: docker exec wordpress_mysql_1 mysql -uroot -ppassword -e "CREATE DATABASE deckapp" | |
- name: Verify Database create or not | |
run: docker exec wordpress_mysql_1 mysql -uroot -ppassword -e "SHOW DATABASES" | |
- name: Destroy Container and file | |
run: | | |
docker-compose down | |
echo "y" | docker system prune -a | |
echo "y" | docker image prune -a | |
echo "y" | docker volume prune | |
sudo rm -rf /tmp/wordpress | |
sudo rm -rf /tmp/db | |
- name: Create ENV | |
env: | |
ENV_TEST: ${{ secrets.ENV_TEST }} | |
run: | | |
echo "$ENV_TEST" > .env.test | |
shell: bash | |
- name: Notify on SUCCESS | |
if: ${{ SUCCESS() }} | |
uses: ravsamhq/notify-slack-action@v2 | |
with: | |
status: ${{ job.status }} | |
notification_title: "{emoji} *{job}* has {status_message}" | |
message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}" | |
footer: "Linked Repo <{repo_url}|{repo}>" | |
mention_users: "D056LFW47NF," | |
mention_users_when: "SUCCESS" | |
mention_groups: "C06H0SB11JL" | |
mention_groups_when: "SUCCESS" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_SUCCESS }} | |
- name: Notify on FAIL | |
if: ${{ failure() }} | |
uses: ravsamhq/notify-slack-action@v2 | |
with: | |
status: ${{ job.status }} | |
notification_title: "{emoji} *{job}* has {status_message}" | |
message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}" | |
footer: "Linked Repo <{repo_url}|{repo}>" | |
mention_users: "D056LFW47NF" | |
mention_users_when: "failure,warnings" | |
mention_groups: "C06G95T1YH3" | |
mention_groups_when: "failure,warnings" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FAIL }} | |
Wordpress-ARM64: | |
runs-on: ubuntu-22.04 | |
name: Wordpress-ARM64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: uraimo/run-on-arch-action@v2 | |
name: Run commands | |
id: runcmd | |
with: | |
arch: aarch64 | |
distro: ubuntu22.04 | |
run: | | |
uname -a | |
echo ::set-output name=uname::$(uname -a) | |
- name: Get the output | |
run: | | |
echo "The uname output was ${{ steps.runcmd.outputs.uname }}" | |
- name: Build the Docker image wordpress latest | |
run: docker-compose -f "docker-compose.yml" up -d --build | |
env: | |
MARIADB_VERSION: 10.7 | |
APP_CODE_PATH_HOST: /tmp/wordpress | |
DB_NAME: test | |
DB_USER: admin | |
DB_PASSWORD: password | |
DB_ROOT_PASSWORD: password | |
DATA_PATH_HOST: /tmp/db | |
USER_ID: "0" | |
GROUP_ID: "0" | |
- name: PHP version check | |
run : docker exec wordpress_wordpress_1 php -v | |
- name: Mysql Driver check | |
run: docker exec wordpress_wordpress_1 php -m | grep mysqli | |
- name: Wordpress CLI check | |
run: docker exec wordpress_wordpress_1 wp --info | grep WP-CLI | |
- name: Web site Test | |
run: | | |
sleep 50s | |
sudo curl -I --http2 http://localhost:44181/wp-admin/install.php | |
- name: Verify MariaDB running from host, create Database and show Database | |
run: | | |
while ! docker exec wordpress_mysql_1 mysqladmin --user=root --password=password --host "mysql" ping --silent &> /dev/null ; do | |
echo "Waiting for database connection..." | |
sleep 2 | |
done | |
- name: Check MariaDB version | |
run: docker exec wordpress_mysql_1 mysql -uroot -ppassword -e "SHOW VARIABLES LIKE '%version%';" | |
- name: Verify MariaDB database from user | |
run: docker exec wordpress_mysql_1 mysql -uadmin -ppassword -e "SHOW DATABASES" | |
- name: Create a Database | |
run: docker exec wordpress_mysql_1 mysql -uroot -ppassword -e "CREATE DATABASE deckapp" | |
- name: Verify Database create or not | |
run: docker exec wordpress_mysql_1 mysql -uroot -ppassword -e "SHOW DATABASES" | |
- name: Destroy Container and file | |
run: | | |
docker-compose down | |
echo "y" | docker system prune -a | |
echo "y" | docker image prune -a | |
echo "y" | docker volume prune | |
sudo rm -rf /tmp/wordpress | |
sudo rm -rf /tmp/db | |
- name: Create ENV | |
env: | |
ENV_TEST: ${{ secrets.ENV_TEST }} | |
run: | | |
echo "$ENV_TEST" > .env.test | |
shell: bash | |
- name: Notify on SUCCESS | |
if: ${{ SUCCESS() }} | |
uses: ravsamhq/notify-slack-action@v2 | |
with: | |
status: ${{ job.status }} | |
notification_title: "{emoji} *{job}* has {status_message}" | |
message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}" | |
footer: "Linked Repo <{repo_url}|{repo}>" | |
mention_users: "D056LFW47NF," | |
mention_users_when: "SUCCESS" | |
mention_groups: "C06H0SB11JL" | |
mention_groups_when: "SUCCESS" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_SUCCESS }} | |
- name: Notify on FAIL | |
if: ${{ failure() }} | |
uses: ravsamhq/notify-slack-action@v2 | |
with: | |
status: ${{ job.status }} | |
notification_title: "{emoji} *{job}* has {status_message}" | |
message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}" | |
footer: "Linked Repo <{repo_url}|{repo}>" | |
mention_users: "D056LFW47NF" | |
mention_users_when: "failure,warnings" | |
mention_groups: "C06G95T1YH3" | |
mention_groups_when: "failure,warnings" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FAIL }} | |