Skip to content

Commit 7ed4287

Browse files
Eric Lopesnullhack
andcommitted
including-default-CICD-on-every-project (#3)
Co-authored-by: Eric Lopes <[email protected]> Reviewed-on: https://gitea.eol.myds.me/eol/python-project-template/pulls/3
1 parent 71f76b3 commit 7ed4287

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{% raw %}
2+
name: Release Docker Image CI/CD
3+
4+
on:
5+
release:
6+
types: [ published ]
7+
8+
jobs:
9+
set-up-docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v4
15+
-
16+
name: Install docker
17+
run: apt update && apt install -y docker-compose
18+
-
19+
name: Login to Docker Hub
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ${{ vars.DOCKER_REGISTRY_URL }}
23+
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
24+
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
25+
-
26+
name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
-
29+
name: Build and push
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: .
33+
file: ./Dockerfile
34+
push: true
35+
tags: ${{ vars.DOCKER_REGISTRY_URL }}/${{ github.event.repository.name }}:${{ github.ref_name }}
36+
{% endraw %}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{% raw %}
2+
name: Test Docker Image CI/CD
3+
4+
on:
5+
push:
6+
branches:
7+
- '*'
8+
- '!main'
9+
- '!master'
10+
- '!prod'
11+
12+
jobs:
13+
set-up-docker:
14+
runs-on: ubuntu-latest
15+
steps:
16+
-
17+
name: Checkout
18+
uses: actions/checkout@v4
19+
-
20+
name: Install docker
21+
run: apt update && apt install -y docker-compose
22+
-
23+
name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
-
26+
name: Build and test
27+
uses: docker/build-push-action@v5
28+
with:
29+
context: .
30+
file: ./Dockerfile
31+
push: false
32+
{% endraw %}

0 commit comments

Comments
 (0)