peter-evans / docker-compose-actions-workflow Goto Github PK
View Code? Open in Web Editor NEWGitHub Actions workflow example using Docker Compose to build and test a multi-container stack
License: MIT License
GitHub Actions workflow example using Docker Compose to build and test a multi-container stack
License: MIT License
The run logs in README example are expired and therefore not visible. Since it's a big part of the example it would be great if they were at least rerun. To increase resiliency something like screenshotting the most relevant bits and adding them directly to the README might make rerunning less urgent in the future?
Nice example, but when running in my action, it failed.
Action Logs:
Run docker run --rm appropriate/curl -s --retry 3 --retry-connrefused http://localhost:8080/
Unable to find image 'appropriate/curl:latest' locally
latest: Pulling from appropriate/curl
ff3a5c916c92: Pulling fs layer
3151abf94102: Pulling fs layer
58ae3cb4aac4: Pulling fs layer
3151abf94102: Verifying Checksum
3151abf94102: Download complete
58ae3cb4aac4: Verifying Checksum
58ae3cb4aac4: Download complete
ff3a5c916c92: Download complete
ff3a5c916c92: Pull complete
3151abf94102: Pull complete
58ae3cb4aac4: Pull complete
Digest: sha256:c8bf5bbec6397465a247c2bb3e589bb77e4f62ff88a027175ecb2d9e4f12c9d7
Status: Downloaded newer image for appropriate/curl:latest
##[error]Process completed with exit code 7.
My docker-compose file:
version: '3.7'
services:
wordpress:
image: wordpress:latest
depends_on:
- wordpress_db
ports:
- "8080:80"
# volumes:
# - type: bind
# source: ./wp-content
# target: /var/www/html/wp-content
restart: always
environment:
WORDPRESS_DB_HOST: wordpress_db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: secret
WORDPRESS_DB_NAME: wordpress
wordpress_db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: secret
phpmyadmin:
image: phpmyadmin/phpmyadmin
depends_on:
- wordpress_db
restart: always
ports:
- "8888:80"
environment:
PMA_HOST: wordpress_db
MYSQL_ROOT_PASSWORDL: secret
networks:
- back
networks:
back:
volumes:
db_data: {}
My action workflow file:
name: build
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build services
run: docker-compose up -d
- name: List container
run: docker-compose ps
- name: Test Wordpress container
run: docker run --rm --network container:wordpress-docker-compose_wordpress_1 appropriate/curl -s --retry 3 --retry-connrefused http://localhost:8080/
- name: Test PhpMyAdmin container
run: docker run --rm --network container:wordpress-docker-compose_phpmyadmin_1 appropriate/curl -s --retry 3 --retry-connrefused http://localhost:8888/
Hey there!
Nice example. Did you thought about using actions/cache to cache docker images that have to be downloaded every build?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.