Skip to content

CI - nginx

CI - nginx #1

Workflow file for this run

name: CI - nginx
on:
push:
branches:
- main
paths:
- 'compose/**'
schedule:
- cron: '0 0 * * Mon'
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker images
run: |
IMAGE=filipmania/nginx
docker pull nginx:latest
VER=$(docker run --rm nginx:latest nginx -v 2>&1 1>/dev/null | cut -d/ -f2)
docker build -t ${IMAGE}:${VER} -t ${IMAGE}:latest -f compose/Dockerfile compose
docker push ${IMAGE}:${VER}
docker push ${IMAGE}:latest
- name: Save the IMAGE_TAG
run: echo "IMAGE_TAG=${GITHUB_RUN_ID}"