-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 951 Bytes
/
ci - nginx.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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}"