Bump actions/checkout from 3.3.0 to 4.1.7 #118
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: CI/CD | |
on: [push, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
version: [php, proxy, static] | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Cache Docker layers | |
uses: actions/[email protected] | |
with: | |
path: /tmp/.buildx-cache | |
key: docker-buildx-${{ matrix.version }}-${{ github.sha }} | |
restore-keys: docker-buildx-${{ matrix.version }}- | |
- name: Build | |
run: | | |
docker buildx build \ | |
--cache-from type=local,src=/tmp/.buildx-cache/${{ matrix.version }} \ | |
--cache-to type=local,dest=/tmp/.buildx-cache/${{ matrix.version }} \ | |
--output type=docker \ | |
--tag kooldev/nginx:${{ matrix.version }} \ | |
${{ matrix.version }} | |
- name: Tests | |
run: docker run kooldev/nginx:${{ matrix.version }} nginx -v | |
- name: Login to DockerHub | |
uses: docker/[email protected] | |
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-nginx' | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push to DockerHub | |
if: github.ref == 'refs/heads/master' && github.repository == 'kool-dev/docker-nginx' | |
run: docker push kooldev/nginx:${{ matrix.version }} |