File tree Expand file tree Collapse file tree 2 files changed +68
-0
lines changed
{{cookiecutter.project_slug}}/.github/workflows Expand file tree Collapse file tree 2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
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 %}
Original file line number Diff line number Diff line change
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 %}
You can’t perform that action at this time.
0 commit comments